개정판 c460df05
m-talk 활성화
KCOM/Messenger/ConversationView.xaml.cs | ||
---|---|---|
38 | 38 |
|
39 | 39 |
private void BtnMark_Click(object sender, RoutedEventArgs e) |
40 | 40 |
{ |
41 |
//MessageBox.Show("데모 버전에서는 지원하지 않습니다", "안내"); |
|
42 | 41 |
if (main.dzMainMenu.SelectLayer.Children.Count > 0) |
43 | 42 |
{ |
44 |
//this.ParentOfType<KCOM.Views.MainMenu>().zoomAndPanControl.ZoomTo(rect); |
|
45 |
|
|
46 | 43 |
DialogParameters parameters = new DialogParameters() |
47 | 44 |
{ |
48 | 45 |
Closed = (obj, args) => this.MarkupNameUpdatePromptClose(args), |
49 |
//DefaultPromptResultValue = "Custom State", |
|
50 | 46 |
Content = "메모 :", |
51 | 47 |
Header = "앵커에 대한 메모을 남겨주세요", |
52 | 48 |
Theme = new VisualStudio2013Theme(), |
... | ... | |
90 | 86 |
{ |
91 | 87 |
Controls.AdornerFinal finalItem = main.dzMainMenu.SelectLayer.Children[0] as Controls.AdornerFinal; |
92 | 88 |
Rect rect = new Rect(new Point(finalItem.BorderSize.Left - 100, finalItem.BorderSize.Top - 100), new Point(finalItem.BorderSize.Right + 100, finalItem.BorderSize.Bottom + 100)); |
93 |
|
|
94 |
using (KCOMDataModel.DataModel.CIEntities entity = new KCOMDataModel.DataModel.CIEntities(KCOMDataModel.Common.ConnectStringBuilder.ProjectCIConnectString(App.ViewInfo.ProjectNO).ToString())) |
|
89 |
KCOMDataModel.DataModel.TALK message = new KCOMDataModel.DataModel.TALK |
|
90 |
{ |
|
91 |
TEXT = args.PromptResult, |
|
92 |
MSGSIDE = (int)MessageSide.Me, |
|
93 |
MEMBER_ID = App.ViewInfo.UserID, |
|
94 |
MEMBER_NAME = App.UserName, |
|
95 |
MSGTYPE = (int)MessageType.Anchor, |
|
96 |
TIMESTAMP = DateTime.Now, |
|
97 |
DOCUMENT_ID = App.ViewInfo.DocumentItemID, |
|
98 |
RECT_X = rect.X, |
|
99 |
RECT_Y = rect.Y, |
|
100 |
RECT_WIDTH = rect.Width, |
|
101 |
RECT_HEIGHT = rect.Height, |
|
102 |
PAGENUMBER = Common.ViewerDataModel.Instance.PageNumber |
|
103 |
}; |
|
104 |
|
|
105 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddMessage(App.ViewInfo.ProjectNO, message); |
|
106 |
|
|
107 |
List<KCOMDataModel.DataModel.TALK> messagelist = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetMessage(App.ViewInfo.ProjectNO, App.ViewInfo.DocumentItemID); |
|
108 |
|
|
109 |
messagelist.ForEach(a => |
|
95 | 110 |
{ |
96 |
Common.ViewerDataModel.Instance.k_talkMessageSet.Clear(); |
|
97 |
entity.TALK.AddObject(new KCOMDataModel.DataModel.TALK |
|
98 |
{ |
|
99 |
TEXT = args.PromptResult, |
|
100 |
MSGSIDE = (int)MessageSide.Me, |
|
101 |
MEMBER_ID = App.ViewInfo.UserID, |
|
102 |
MEMBER_NAME = String.IsNullOrEmpty(App.UserName) ? entity.MEMBER.Where(d => d.ID == App.ViewInfo.UserID).FirstOrDefault().NAME : App.UserName, |
|
103 |
MSGTYPE = (int)MessageType.Anchor, |
|
104 |
TIMESTAMP = DateTime.Now, |
|
105 |
DOCUMENT_ID = App.ViewInfo.DocumentItemID, |
|
106 |
RECT_X = rect.X, |
|
107 |
RECT_Y = rect.Y, |
|
108 |
RECT_WIDTH = rect.Width, |
|
109 |
RECT_HEIGHT = rect.Height, |
|
110 |
PAGENUMBER = Common.ViewerDataModel.Instance.PageNumber, |
|
111 |
}); |
|
112 |
entity.SaveChanges(); |
|
113 |
|
|
114 |
entity.TALK.Where(data => data.DOCUMENT_ID == App.ViewInfo.DocumentItemID).ToList().ForEach(a => |
|
115 |
{ |
|
116 |
Common.ViewerDataModel.Instance.k_talkMessageSet.Add(a); |
|
117 |
}); |
|
118 |
} |
|
111 |
Common.ViewerDataModel.Instance.k_talkMessageSet.Add(a); |
|
112 |
}); |
|
119 | 113 |
|
120 | 114 |
tbContent.Text = ""; |
121 | 115 |
tbContent.Focus(); |
122 |
|
|
123 |
//Common.ViewerDataModel.Instance.k_talkMessageSet.Add(new KCOMDataModel.DataModel.TALK |
|
124 |
//{ |
|
125 |
// Text = args.PromptResult, |
|
126 |
// Side = MessageSide.Me, |
|
127 |
// AnchorBound = rect, |
|
128 |
// UserName = "조장원", |
|
129 |
// PageNumber = main.dzMainMenu.pageNavigator.CurrentPage.PageNumber, |
|
130 |
// MsgStype = MessageType.Anchor, |
|
131 |
// Timestamp = DateTime.Now, |
|
132 |
//}); |
|
133 |
//this.DataContext = this; |
|
116 |
(lstMessage.Parent as ScrollViewer).ScrollToEnd(); |
|
134 | 117 |
} |
135 | 118 |
} |
136 | 119 |
} |
... | ... | |
156 | 139 |
if (App.ParameterMode) |
157 | 140 |
{ |
158 | 141 |
ClickAnchorCommand = new Telerik.Windows.Controls.DelegateCommand(SaveAuthorization); |
159 |
|
|
142 |
if (string.IsNullOrEmpty(App.UserName)) |
|
143 |
{ |
|
144 |
App.UserName = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetMember(App.ViewInfo.ProjectNO, App.ViewInfo.UserID).NAME; |
|
145 |
} |
|
160 | 146 |
if (Common.ViewerDataModel.Instance.k_talkMessageSet.Count() == 0) |
161 | 147 |
{ |
162 |
using (KCOMDataModel.DataModel.CIEntities entity = new KCOMDataModel.DataModel.CIEntities(KCOMDataModel.Common.ConnectStringBuilder.ProjectCIConnectString(App.ViewInfo.ProjectNO).ToString())) |
|
148 |
List<KCOMDataModel.DataModel.TALK> messagelist = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetMessage(App.ViewInfo.ProjectNO, App.ViewInfo.DocumentItemID); |
|
149 |
|
|
150 |
messagelist.ForEach(a => |
|
163 | 151 |
{ |
164 |
entity.TALK.Where(data => data.DOCUMENT_ID == App.ViewInfo.DocumentItemID).ToList().ForEach(a => |
|
165 |
{ |
|
166 |
Common.ViewerDataModel.Instance.k_talkMessageSet.Add(a); |
|
167 |
}); |
|
168 |
} |
|
152 |
Common.ViewerDataModel.Instance.k_talkMessageSet.Add(a); |
|
153 |
}); |
|
154 |
(lstMessage.Parent as ScrollViewer).ScrollToEnd(); |
|
169 | 155 |
} |
170 | 156 |
tbContent.KeyDown += async (s, ea) => await OnKeyDownHandler(s, ea); |
157 |
|
|
171 | 158 |
} |
172 | 159 |
} |
173 | 160 |
|
... | ... | |
192 | 179 |
|
193 | 180 |
private void AddText() |
194 | 181 |
{ |
195 |
using (KCOMDataModel.DataModel.CIEntities entity = new KCOMDataModel.DataModel.CIEntities(KCOMDataModel.Common.ConnectStringBuilder.ProjectCIConnectString(App.ViewInfo.ProjectNO).ToString())) |
|
182 |
Common.ViewerDataModel.Instance.k_talkMessageSet.Clear(); |
|
183 |
|
|
184 |
KCOMDataModel.DataModel.TALK message = new KCOMDataModel.DataModel.TALK |
|
196 | 185 |
{ |
197 |
Common.ViewerDataModel.Instance.k_talkMessageSet.Clear(); |
|
198 |
entity.TALK.AddObject(new KCOMDataModel.DataModel.TALK |
|
199 |
{ |
|
200 |
TEXT = tbContent.Text, |
|
201 |
MSGSIDE = (int)MessageSide.Me, |
|
202 |
MEMBER_ID = App.ViewInfo.UserID, |
|
203 |
MEMBER_NAME = String.IsNullOrEmpty(App.UserName) ? entity.MEMBER.Where(d => d.ID == App.ViewInfo.UserID).FirstOrDefault().NAME : App.UserName , |
|
204 |
MSGTYPE = (int)MessageType.Normal, |
|
205 |
TIMESTAMP = DateTime.Now, |
|
206 |
DOCUMENT_ID = App.ViewInfo.DocumentItemID, |
|
207 |
}); |
|
208 |
entity.SaveChanges(); |
|
209 |
|
|
210 |
entity.TALK.Where(data => data.DOCUMENT_ID == App.ViewInfo.DocumentItemID).ToList().ForEach(a => |
|
211 |
{ |
|
212 |
Common.ViewerDataModel.Instance.k_talkMessageSet.Add(a); |
|
213 |
}); |
|
214 |
} |
|
186 |
TEXT = tbContent.Text, |
|
187 |
MSGSIDE = (int)MessageSide.Me, |
|
188 |
MEMBER_ID = App.ViewInfo.UserID, |
|
189 |
MEMBER_NAME = App.UserName, |
|
190 |
MSGTYPE = (int)MessageType.Normal, |
|
191 |
TIMESTAMP = DateTime.Now, |
|
192 |
DOCUMENT_ID = App.ViewInfo.DocumentItemID |
|
193 |
}; |
|
215 | 194 |
|
216 |
tbContent.Text = ""; |
|
217 |
tbContent.Focus(); |
|
195 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddMessage(App.ViewInfo.ProjectNO, message); |
|
218 | 196 |
|
219 |
//강인구 추가 |
|
220 |
(lstMessage.Parent as ScrollViewer).ScrollToEnd(); |
|
197 |
List<KCOMDataModel.DataModel.TALK> messagelist = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetMessage(App.ViewInfo.ProjectNO, App.ViewInfo.DocumentItemID); |
|
221 | 198 |
|
222 |
//ReLoadTalkMessageSet(); |
|
223 |
//Common.ViewerDataModel.Instance.k_talkMessageSet.Add(new Message |
|
224 |
//{ |
|
225 |
// Text = tbContent.Text, |
|
226 |
// Side = MessageSide.Me, |
|
227 |
// Timestamp = DateTime.Now, |
|
228 |
//}); |
|
229 |
|
|
230 |
//tbContent.Text = ""; |
|
231 |
//tbContent.Focus(); |
|
199 |
messagelist.ForEach(a => |
|
200 |
{ |
|
201 |
Common.ViewerDataModel.Instance.k_talkMessageSet.Add(a); |
|
202 |
}); |
|
203 |
tbContent.Text = ""; |
|
204 |
tbContent.Focus(); |
|
205 |
(lstMessage.Parent as ScrollViewer).ScrollToEnd(); |
|
206 |
|
|
232 | 207 |
} |
233 | 208 |
} |
234 | 209 |
} |
내보내기 Unified diff