private void btnLookUpOwner_Click(object sender, RoutedEventArgs e)
 {
     SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
     lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel;
     lookup.SelectedClick  += (obj, ev) =>
     {
         List <SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj> ent = lookup.SelectedObj as List <SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj>;
         if (ent != null && ent.Count > 0)
         {
             SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj companyInfo = ent.FirstOrDefault();
             SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE           empInfo     = (SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE)companyInfo.ObjectInstance;
             accidentInfo = new T_OA_ACCIDENTRECORD();
             accidentInfo.OWNERCOMPANYID    = empInfo.OWNERCOMPANYID;
             accidentInfo.OWNERDEPARTMENTID = empInfo.OWNERDEPARTMENTID;
             accidentInfo.OWNERID           = empInfo.EMPLOYEEID;
             accidentInfo.OWNERNAME         = empInfo.EMPLOYEECNAME;
             if (accidentInfo.OWNERNAME == null)
             {
                 accidentInfo.OWNERNAME = companyInfo.ObjectName;
             }
             accidentInfo.OWNERPOSTID = empInfo.T_HR_EMPLOYEEPOST.FirstOrDefault().EMPLOYEEPOSTID;
             //PersonnelServiceClient psClient = new PersonnelServiceClient();
             //psClient.GetEmployeeByIDAsync(empInfo.EMPLOYEEID);
             //psClient.GetEmployeeByIDCompleted += new EventHandler<GetEmployeeByIDCompletedEventArgs>(psClient_GetEmployeeByIDCompleted);
             txtOwnerName.Text = companyInfo.ObjectName;
         }
     };
     lookup.MultiSelected = true;
     lookup.Show();
 }
 private void SetFormDefailValue(T_OA_ACCIDENTRECORD defaultInfo)
 {
     txtContent.Text   = defaultInfo.CONTENT;
     dpDate.Text       = defaultInfo.ACCIDENTDATE.ToShortDateString();
     txtOwnerID.Text   = defaultInfo.OWNERID;
     txtOwnerName.Text = defaultInfo.OWNERNAME;
 }
示例#3
0
 private int UpdateAccidentRecord(T_OA_ACCIDENTRECORD cvInfo)
 {
     AccidentRecordManageBll accidentRecordBll = new AccidentRecordManageBll();
     if (accidentRecordBll.UpdateInfo(cvInfo) == -1)
     {
         return -1;
     }
     return 1;
 }
示例#4
0
 private int AddAccidentRecord(T_OA_ACCIDENTRECORD cvInfo)
 {
     AccidentRecordManageBll accidentRecordBll = new AccidentRecordManageBll();
     if (accidentRecordBll.AddInfo(cvInfo) == true)
     {
         return 1;
     }
     return -1;
 }
示例#5
0
        private int UpdateAccidentRecord(T_OA_ACCIDENTRECORD cvInfo)
        {
            AccidentRecordManageBll accidentRecordBll = new AccidentRecordManageBll();

            if (accidentRecordBll.UpdateInfo(cvInfo) == -1)
            {
                return(-1);
            }
            return(1);
        }
示例#6
0
        private int AddAccidentRecord(T_OA_ACCIDENTRECORD cvInfo)
        {
            AccidentRecordManageBll accidentRecordBll = new AccidentRecordManageBll();

            if (accidentRecordBll.AddInfo(cvInfo) == true)
            {
                return(1);
            }
            return(-1);
        }
        private void UpdateInfo(T_OA_ACCIDENTRECORD updateInfo)
        {
            string StrStart = string.Empty;

            StrStart = dpDate.Text.ToString();
            DateTime DtStart = new DateTime();

            if (!Check())
            {
                return;
            }
            if (!string.IsNullOrEmpty(StrStart))
            {
                DtStart = System.Convert.ToDateTime(StrStart);
                if (DtStart > DateTime.Now)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CANNOTBEGREATERTHANTHECURRENTDATE", "ACCIDENTDATE"));
                    return;
                }
            }

            updateInfo.T_OA_VEHICLE      = (T_OA_VEHICLE)cmbVehicleAssetId.SelectedItem;
            updateInfo.ACCIDENTDATE      = Convert.ToDateTime(dpDate.Text);
            updateInfo.CONTENT           = txtContent.Text;
            updateInfo.OWNERID           = txtOwnerID.Text;
            updateInfo.OWNERCOMPANYID    = accidentInfo.OWNERCOMPANYID;
            updateInfo.OWNERDEPARTMENTID = accidentInfo.OWNERDEPARTMENTID;
            updateInfo.OWNERPOSTID       = accidentInfo.OWNERPOSTID;
            updateInfo.OWNERNAME         = accidentInfo.OWNERNAME;
            updateInfo.OWNERID           = accidentInfo.OWNERID;
            updateInfo.UPDATEDATE        = System.DateTime.Now;
            updateInfo.UPDATEUSERID      = Common.CurrentLoginUserInfo.EmployeeID;
            updateInfo.UPDATEUSERID      = Common.CurrentLoginUserInfo.EmployeeName;
            RefreshUI(RefreshedTypes.ShowProgressBar);
            try
            {
                vehicleManager.UpdateAccidentRecordAsync(updateInfo);
            }
            catch (Exception ex)
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"));
            }
        }
 private List <T_OA_ACCIDENTRECORD> GetSearchDate(T_OA_ACCIDENTRECORD searchInfo, List <T_OA_ACCIDENTRECORD> accidentRecordInfoList)
 {
     if (searchInfo.T_OA_VEHICLE.ASSETID != null)
     {
         accidentRecordInfoList = accidentRecordInfoList.Where(ent => ent.T_OA_VEHICLE.ASSETID == searchInfo.T_OA_VEHICLE.ASSETID).ToList();
     }
     if (searchInfo.ACCIDENTDATE != null && searchInfo.ACCIDENTDATE != new DateTime(1, 1, 1, 0, 0, 0))
     {
         accidentRecordInfoList = accidentRecordInfoList.Where(ent => ent.ACCIDENTDATE == searchInfo.ACCIDENTDATE).ToList();
     }
     if (accidentRecordInfoList != null && accidentRecordInfoList.Count > 0)
     {
         return(accidentRecordInfoList);
     }
     else
     {
         return(null);
     }
 }
 private List<T_OA_ACCIDENTRECORD> GetSearchDate(T_OA_ACCIDENTRECORD searchInfo, List<T_OA_ACCIDENTRECORD> accidentRecordInfoList)
 {
     if (searchInfo.T_OA_VEHICLE.ASSETID != null)
     {
         accidentRecordInfoList = accidentRecordInfoList.Where(ent => ent.T_OA_VEHICLE.ASSETID == searchInfo.T_OA_VEHICLE.ASSETID).ToList();
     }
     if (searchInfo.ACCIDENTDATE != null && searchInfo.ACCIDENTDATE != new DateTime(1, 1, 1, 0, 0, 0))
     {
         accidentRecordInfoList = accidentRecordInfoList.Where(ent => ent.ACCIDENTDATE == searchInfo.ACCIDENTDATE).ToList();
     }
     if (accidentRecordInfoList != null && accidentRecordInfoList.Count > 0)
     {
         return accidentRecordInfoList;
     }
     else
     {
         return null;
     }
 }
        private void AddInfo()
        {
            string StrStart = string.Empty;

            StrStart = dpDate.Text.ToString();
            DateTime DtStart = new DateTime();

            if (!Check())
            {
                return;
            }
            if (!string.IsNullOrEmpty(StrStart))
            {
                DtStart = System.Convert.ToDateTime(StrStart);
                if (DtStart > DateTime.Now)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CANNOTBEGREATERTHANTHECURRENTDATE", "ACCIDENTDATE"));
                    return;
                }
            }
            T_OA_ACCIDENTRECORD newInfo = new T_OA_ACCIDENTRECORD();

            newInfo.T_OA_VEHICLE = (T_OA_VEHICLE)cmbVehicleAssetId.SelectedItem;
            try
            {
                newInfo.ACCIDENTDATE = Convert.ToDateTime(dpDate.Text);
            }
            catch
            {
                Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("ISNotAllowed", "AccidentTime"));
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }
            if (txtOwnerName.Text == "")
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIRED", "OWNERID"));

                return;
            }
            newInfo.CONTENT            = txtContent.Text;
            newInfo.ACCIDENTRECORDID   = System.Guid.NewGuid().ToString();
            newInfo.CREATECOMPANYID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            newInfo.CREATEDATE         = System.DateTime.Now;
            newInfo.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
            newInfo.CREATEPOSTID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            newInfo.CREATEUSERID       = Common.CurrentLoginUserInfo.EmployeeID;
            newInfo.CREATEUSERNAME     = Common.CurrentLoginUserInfo.EmployeeName;
            newInfo.OWNERCOMPANYID     = accidentInfo.OWNERCOMPANYID;
            newInfo.OWNERDEPARTMENTID  = accidentInfo.OWNERDEPARTMENTID;
            newInfo.OWNERPOSTID        = accidentInfo.OWNERPOSTID;
            newInfo.OWNERNAME          = accidentInfo.OWNERNAME;
            newInfo.OWNERID            = accidentInfo.OWNERID;
            newInfo.UPDATEDATE         = System.DateTime.Now;
            newInfo.UPDATEUSERID       = Common.CurrentLoginUserInfo.EmployeeID;
            newInfo.UPDATEUSERNAME     = Common.CurrentLoginUserInfo.EmployeeName;
            newInfo.FLAG = "0";
            RefreshUI(RefreshedTypes.ShowProgressBar);
            try
            {
                vehicleManager.AddAccidentRecordAsync(newInfo);
                // accidentInfo = new T_OA_ACCIDENTRECORD();
                txtOwnerID.Text = accidentInfo.OWNERID;
                accidentInfo    = newInfo;
            }
            catch (Exception ex)
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                throw (ex);
            }
        }
示例#11
0
 private void btnLookUpOwner_Click(object sender, RoutedEventArgs e)
 {
     SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
     lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel;
     lookup.SelectedClick += (obj, ev) =>
     {
         List<SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj> ent = lookup.SelectedObj as List<SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj>;
         if (ent != null && ent.Count > 0)
         {
             SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj companyInfo = ent.FirstOrDefault();
             SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE empInfo = (SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE)companyInfo.ObjectInstance;
             accidentInfo = new T_OA_ACCIDENTRECORD();
             accidentInfo.OWNERCOMPANYID = empInfo.OWNERCOMPANYID;
             accidentInfo.OWNERDEPARTMENTID = empInfo.OWNERDEPARTMENTID;
             accidentInfo.OWNERID = empInfo.EMPLOYEEID;
             accidentInfo.OWNERNAME = empInfo.EMPLOYEECNAME;
             if (accidentInfo.OWNERNAME == null)
             {
                 accidentInfo.OWNERNAME = companyInfo.ObjectName;
             }
             accidentInfo.OWNERPOSTID = empInfo.T_HR_EMPLOYEEPOST.FirstOrDefault().EMPLOYEEPOSTID;
             //PersonnelServiceClient psClient = new PersonnelServiceClient();
             //psClient.GetEmployeeByIDAsync(empInfo.EMPLOYEEID);
             //psClient.GetEmployeeByIDCompleted += new EventHandler<GetEmployeeByIDCompletedEventArgs>(psClient_GetEmployeeByIDCompleted);
             txtOwnerName.Text = companyInfo.ObjectName;
         }
     };
     lookup.MultiSelected = true;
     lookup.Show();
 }
示例#12
0
        private void UpdateInfo(T_OA_ACCIDENTRECORD updateInfo)
        {
            string StrStart = string.Empty;
            StrStart = dpDate.Text.ToString();
            DateTime DtStart = new DateTime();
            if (!Check()) return;
            if (!string.IsNullOrEmpty(StrStart))
            {
                DtStart = System.Convert.ToDateTime(StrStart);
                if (DtStart > DateTime.Now)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CANNOTBEGREATERTHANTHECURRENTDATE", "ACCIDENTDATE"));
                    return;
                }
            }

            updateInfo.T_OA_VEHICLE = (T_OA_VEHICLE)cmbVehicleAssetId.SelectedItem;
            updateInfo.ACCIDENTDATE = Convert.ToDateTime(dpDate.Text);
            updateInfo.CONTENT = txtContent.Text;
            updateInfo.OWNERID = txtOwnerID.Text;
            updateInfo.OWNERCOMPANYID = accidentInfo.OWNERCOMPANYID;
            updateInfo.OWNERDEPARTMENTID = accidentInfo.OWNERDEPARTMENTID;
            updateInfo.OWNERPOSTID = accidentInfo.OWNERPOSTID;
            updateInfo.OWNERNAME = accidentInfo.OWNERNAME;
            updateInfo.OWNERID = accidentInfo.OWNERID;
            updateInfo.UPDATEDATE = System.DateTime.Now;
            updateInfo.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;
            updateInfo.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeName;
            RefreshUI(RefreshedTypes.ShowProgressBar);
            try
            {
                vehicleManager.UpdateAccidentRecordAsync(updateInfo);
            }
            catch (Exception ex)
            { 
                RefreshUI(RefreshedTypes.HideProgressBar);
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"));
            }
        }
示例#13
0
        private void AddInfo()
        {
            
            string StrStart = string.Empty;
            StrStart = dpDate.Text.ToString();
            DateTime DtStart = new DateTime();
            if (!Check()) return;
            if (!string.IsNullOrEmpty(StrStart))
            {
                DtStart = System.Convert.ToDateTime(StrStart);
                if (DtStart > DateTime.Now)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CANNOTBEGREATERTHANTHECURRENTDATE", "ACCIDENTDATE"));
                    return;
                }
            }
            T_OA_ACCIDENTRECORD newInfo = new T_OA_ACCIDENTRECORD();
            newInfo.T_OA_VEHICLE = (T_OA_VEHICLE)cmbVehicleAssetId.SelectedItem;
            try
            {
                newInfo.ACCIDENTDATE = Convert.ToDateTime(dpDate.Text);
            }
            catch
            {
                Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("ISNotAllowed", "AccidentTime"));
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }
            if (txtOwnerName.Text == "")
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIRED", "OWNERID"));

                return;
            }
            newInfo.CONTENT = txtContent.Text;
            newInfo.ACCIDENTRECORDID = System.Guid.NewGuid().ToString();
            newInfo.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            newInfo.CREATEDATE = System.DateTime.Now;
            newInfo.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
            newInfo.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            newInfo.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;
            newInfo.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;
            newInfo.OWNERCOMPANYID = accidentInfo.OWNERCOMPANYID;
            newInfo.OWNERDEPARTMENTID = accidentInfo.OWNERDEPARTMENTID;
            newInfo.OWNERPOSTID = accidentInfo.OWNERPOSTID;
            newInfo.OWNERNAME = accidentInfo.OWNERNAME;
            newInfo.OWNERID = accidentInfo.OWNERID;
            newInfo.UPDATEDATE = System.DateTime.Now;
            newInfo.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;
            newInfo.UPDATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;
            newInfo.FLAG = "0";
            RefreshUI(RefreshedTypes.ShowProgressBar);
            try
            {
                vehicleManager.AddAccidentRecordAsync(newInfo);
               // accidentInfo = new T_OA_ACCIDENTRECORD();
                txtOwnerID.Text = accidentInfo.OWNERID;
                accidentInfo = newInfo;

            }
            catch (Exception ex)
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                throw (ex);

            }
        }
示例#14
0
 private void SetFormDefailValue(T_OA_ACCIDENTRECORD defaultInfo)
 {
     
     txtContent.Text = defaultInfo.CONTENT;
     dpDate.Text = defaultInfo.ACCIDENTDATE.ToShortDateString();
     txtOwnerID.Text = defaultInfo.OWNERID;
     txtOwnerName.Text = defaultInfo.OWNERNAME;
 }