/// <summary> /// Schedule жагсаалт авах /// </summary> /// <param name="ProdType">Бүтээгдэхүүний төрөл ( 0-Бараа,1-Үйлчилгээ).</param> /// <param name="ProdNo">Бүтээгдэхүүний дугаар.</param> /// <param name="Today">Сонгогдож харагдах өдөр</param> /// <param name="DayCount">Сонгогдох өдрөөс хэдэн өдрийн өмнөх болон хойшхи мэдээлэл.</param> /// <returns></returns> public Result RefreshData(int ProdType, string ProdNo, DateTime Today, int DayCount) { ViewInit(); EServ.Shared.Result res = new EServ.Shared.Result(); try { schedulerStorage1.Appointments.DataSource = null; res = _core.RemoteObject.Connection.Call(_core.RemoteObject.User.UserNo, 210, 130121, 130121, new object[] { ProdType, ProdNo, Today, Static.ToDateTime("0001.01.01") }); if (res.ResultNo == 0) { DataTable dt = new DataTable(); dt = res.Data.Tables[0]; schedulerControl1.Storage.Appointments.DataSource = dt; schedulerControl1.Storage.Appointments.Mappings.Start = "STARTDATE"; schedulerControl1.Storage.Appointments.Mappings.End = "ENDDATE"; schedulerControl1.Storage.Appointments.Mappings.ResourceId = "LINENUMBER"; schedulerControl1.Storage.Appointments.Mappings.Description = "ORDERNO"; schedulerControl1.Storage.Appointments.Mappings.Subject = "SALESNO"; schedulerControl1.Storage.Appointments.Mappings.Label = "STATUS"; schedulerControl1.GoToDate(Today); } else { MessageBox.Show(res.ResultNo + " : " + res.ResultDesc); } } catch (Exception ex) { MessageBox.Show(ex.Message); res.ResultNo = 1; res.ResultDesc = "Утга олгох үед алдаа гарлаа."; } return(res); }
private void btnSave_Click(object sender, EventArgs e) { if (dteStartDay.DateTime.Date <= dteEndDay.DateTime.Date) { if (this.dteStartDay.DateTime.Date + this.tmeStart.Time.TimeOfDay > this.dteEndDay.DateTime.Date + this.tmeEnd.Time.TimeOfDay) { MessageBox.Show("Эхлэх дуусах цаг алдаатай байна."); return; } } else { MessageBox.Show("Эхлэх дуусах огноо алдаатай байна."); return; } if (!controller.IsConflictResolved()) { return; } controller.Subject = Static.ToStr(txtSalesNo.EditValue); controller.Description = Static.ToStr(txtOrderNo.EditValue); controller.SetLabel(edLabel.Label); //controller.AllDay = this.checkAllDay.Checked; controller.DisplayStart = this.dteStartDay.DateTime.Date + this.tmeStart.Time.TimeOfDay; controller.DisplayEnd = this.dteEndDay.DateTime.Date + this.tmeEnd.Time.TimeOfDay; controller.Custom1 = txtOrderNo.Text; controller.ResourceId = resType.EditValue; // Save all changes of the editing appointment. controller.ApplyChanges(); EServ.Shared.Result res = new EServ.Shared.Result(); object[] obj = new object[8]; obj[0] = _prodtype; obj[1] = _prodno; obj[2] = Static.ToInt(resType.EditValue); obj[3] = Static.ToStr(txtOrderNo.EditValue); obj[4] = Static.ToStr(txtSalesNo.EditValue); obj[5] = Static.ToDateTime(controller.DisplayStart); obj[6] = Static.ToDateTime(controller.DisplayEnd); string[] labelid = edLabel.Label.MenuCaption.Split('-'); obj[7] = Static.ToInt(labelid[0]); if (isnew) { res = _core.RemoteObject.Connection.Call(_core.RemoteObject.User.UserNo, 210, 130123, 130123, obj); } else { res = _core.RemoteObject.Connection.Call(_core.RemoteObject.User.UserNo, 210, 130124, 130124, new object[] { OldObj, obj }); } if (res.ResultNo != 0) { MessageBox.Show(res.ResultNo + " : " + res.ResultDesc); } Close(); }
void moRemote_Received(EServ.Shared.Result r) { try { switch (r.ResultNo) { case 1: //Огноо солих if (EventDateChanged != null) { DateTime date = lib.ToDate(r.Param[0]); mTxnDate = date; EventDateChanged(date); } break; case 4: //Gl process update if (GLProcessUpdate != null) { GLProcessUpdate(lib.ToStr(r.Param[0]), lib.ToInt(r.Param[1]), lib.ToInt(r.Param[2]), lib.ToStr(r.Param[3]), lib.ToDateTime(r.Param[4]), lib.ToDateTime(r.Param[5])); } break; case 6: //Progress changes if (EventProgressUpdate != null) { EventProgressUpdate(lib.ToStr(r.Param[0]), lib.ToInt(r.Param[1]), lib.ToInt(r.Param[2]), lib.ToStr(r.Param[3]), lib.ToDateTime(r.Param[4]), lib.ToDateTime(r.Param[5])); } break; case 7: //InfoPosEod if (EODUpdate != null) { EODUpdate(EServ.Shared.Static.ToStr(r.Param[0]), EServ.Shared.Static.ToInt(r.Param[1]), EServ.Shared.Static.ToInt(r.Param[2]), EServ.Shared.Static.ToStr(r.Param[3]), EServ.Shared.Static.ToDateTime(r.Param[4]), EServ.Shared.Static.ToDateTime(r.Param[5])); } break; default: if (EventDataReceived != null) { EventDataReceived(r.Param); } break; } } catch (Exception ex) { } }