public AgentUI(long AgentID) { try { InitializeComponent(); var c = Glob.CustomersAndAgents.Agents_Partial.Select_Row_Agent(AgentID); AgentIDForUpdateUse = c.ID; FirstName_Txt.Text = c.FIRST_NAME; LAST_NAMETxt.Text = c.LAST_NAME; Address_Txt.Text = c.ADDRESS; Mobile_Txt.Text = c.MOBILE_NO; EmailTxt.Text = c.EMAIL; StatusToggle.Checked = c.STATUS; Agent_From_Date_link.Text = c.AGENT_FROM.ToLongDateString(); ImageR.Image = Glob.CacheData.Glob_Veriables.GetImageFromByteArray(c.PICTURE); webcam = new WebCam(); webcam.InitializeWebCam(ref ImageR); Panel_info_Extra.Show(); // Availibility_Toggle.Show(); Panel_pictureControls.Hide(); Edit_Btn.Show(); Cancel_Edit_btn.Show(); StatusToggle.Show(); Main_Info_Panel.Enabled = false; SAVE_New_Customer_Btn.Hide(); ImageR.Region = Glob.CacheData.Glob_Veriables.GetRoundRegion(ImageR.Width, ImageR.Height); this.Text = "AGENT " + c.FIRST_NAME.ToUpper() + " ID# " + c.ID.ToString(); } catch (Exception ex) { this.Close(); MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public CustomerUI(long CustomerID) { try { InitializeComponent(); var c = Glob.CustomersAndAgents.CustomersAndAgents_class.Select_Row_Customer(CustomerID); var p = Glob.CustomersAndAgents.Glob_Passport.Get_Select_Row_Passport(CustomerID); OrignalCustomerIDForUpdateUse = c.ID; //for First Name string[] s = c.FIRST_NAME.Split('.'); MrCombo.Text = s[0]; FirstName_Txt.Text = s[1]; LAST_NAMETxt.Text = c.LAST_NAME; Address_Txt.Text = c.ADDRESS; Mobile1_Txt.Text = c.MOBILE_NO; EmailTxt.Text = c.EMAIL; Details_Txt.Text = c.DETAILS; Customer_From_Date_link.Text = c.CUSTOMER_FROM.ToLongDateString(); ImageR.Image = Glob.CacheData.Glob_Veriables.GetImageFromByteArray(c.PICTURE); passportNo_Txt.Text = c.PASSPORT_NO; IsRefferedByCheckBox.Checked = c.IsREFFERED; AgentID_Txt.Text = c.REFFERED_BY.ToString(); if (c.IsREFFERED == true) { AgentID_Txt.Show(); } SrNoTxt.Text = p.SR_NO; Date.Value = p.DATE; NameTxt.Text = p.NAME; passportNo_Txt.Text = p.PASSPORT_NO; cnicTxt.Text = p.CNIC_NO; DateOfBirthDatetime.Value = p.DATE_OF_BIRTH; DateOfIssueDatetime.Value = p.DATE_OF_ISSUE; DateOfExpiryDatetime.Value = p.DATE_OF_EXPIRY; cnicTxt.Text = cnicTxt.Text; Mobile1_Txt.Text = p.CONTACT_NO_1; MobileNo2Txt.Text = p.CONTACT_NO_2; webcam = new WebCam(); webcam.InitializeWebCam(ref ImageR); Panel_info_Extra.Show(); // Availibility_Toggle.Show(); Panel_pictureControls.Hide(); Edit_Btn.Show(); Cancel_Edit_btn.Show(); Main_Info_Panel.Enabled = false; SAVE_New_Customer_Btn.Hide(); ImageR.Region = Glob.CacheData.Glob_Veriables.GetRoundRegion(ImageR.Width, ImageR.Height); this.Text = "CUSTOMER " + c.FIRST_NAME.ToUpper() + " ID# " + c.ID.ToString(); } catch (Exception ex) { this.Close(); } }