private void _GetCustomer() { string idcard = Customer_Idcard_TBx.Text; string fname = Customer_Fname_TBx.Text; string lname = Customer_Lname_TBx.Text; cust_mng = new Customers_Manager(); if (!string.IsNullOrEmpty(idcard) || !string.IsNullOrEmpty(fname) || !string.IsNullOrEmpty(lname)) { List <Customers> list_dlr_all = cust_mng.getCustomers(idcard, fname, lname, 0, 0); int row = list_dlr_all.Count; _pageCount(row); List <Customers> list_cust = cust_mng.getCustomers(idcard, fname, lname, 0, 20); Session["idcard"] = idcard; Session["fname"] = fname; Session["lname"] = lname; Session["row_str"] = 0; Session["List_Customers"] = list_cust; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Login"] == null || Session["Package"] == null) { Response.Redirect("/Authorization/Login"); } package_login = (Base_Companys)Session["Package"]; acc_lgn = (Account_Login)Session["Login"]; if (!IsPostBack) { if (Session["Uploaded"] != null) { Session.Remove("Uploaded"); } if (Request.Params["code"] != null) { string[] code = Request.Params["code"].Split('U'); string Cust_id = code[1]; string number_img = code[2]; Customers_Manager ctm_mng = new Customers_Manager(); Customers_Home_Photo ctm_home_photo = ctm_mng.getCustomersHomePhotoSelected(Cust_id, number_img); if (string.IsNullOrEmpty(ctm_home_photo.Home_img_path)) { ctm_mng.removeCustomersHomePhoto(ctm_home_photo.Cust_id, ctm_home_photo.Home_img_num); } else { File.Delete(ctm_home_photo.Home_img_local_path); ctm_mng.removeCustomersHomePhoto(ctm_home_photo.Cust_id, ctm_home_photo.Home_img_num); } /// Acticity Logs System /// package_login = (Base_Companys)Session["Package"]; acc_lgn = (Account_Login)Session["Login"]; string message = Messages_Logs._messageLogsNormal(acc_lgn.Account_F_name, " ลบรูปบ้าน", acc_lgn.resu, package_login.Company_N_name); new Activity_Log_Manager().addActivityLogs(message, acc_lgn.Account_id, package_login.Company_id); /// Acticity Logs System Session["Remove_Message"] = 1; Session["Class_Active_Customer"] = 2; Response.Redirect("/Form_Customer/Customer_Home_Photo"); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Login"] == null || Session["Package"] == null) { Response.Redirect("/Authorization/Login"); } package_login = (Base_Companys)Session["Package"]; acc_lgn = (Account_Login)Session["Login"]; if (acc_lgn.acc_lv.level_access < 7) { Save_Btn.Visible = false; } if (!IsPostBack) { Session.Remove("List_Customers"); _loadHomeStatus(); _loadNationality(); _loadOrigin(); _loadPersonStatus(); _loadThaiProvinces(); Marry_Panel.Visible = false; Customers ctm = new Customers(); if (Request.Params["code"] == null && Session["Customer"] == null) { Response.Redirect("/Form_Customer/Customer_Add"); } else if (Request.Params["code"] != null) { string[] code = Request.Params["code"].Split('U'); string idcard = code[1]; ctm = new Customers_Manager().getCustomersByIdCard(idcard); Session["Customer"] = ctm; _GetCustomer(ctm); } else { ctm = (Customers)Session["Customer"]; _GetCustomer(ctm); } } }
/******************************************************************************************************************************************************************************* **************************************************** Check Data Function ******************************************************** **************************************************** ******************************************************** *******************************************************************************************************************************************************************************/ private void _CheckCustomer() { Customers ctm_tmp = new Customers_Manager().getCustomersByIdCard(Cust_idcard_TBx.Text); if (ctm_tmp.Cust_Idcard != null) { _GetCustomer(ctm_tmp); Session["chk_customer"] = ctm_tmp; Alert_Warning_Panel.Visible = false; } else { Session.Remove("chk_customer"); Alert_Warning_Panel.Visible = true; Alert_Id_Card_Lbl.Text = "ไม่พบเลขบัตรประชาชน " + Cust_idcard_TBx.Text + " นี้ในระบบข้อมูลลูกค้า"; Cust_idcard_TBx.Focus(); } }
private void _getMoreCustomer(int current_page) { string idcard = (string)Session["idcard"]; string fname = (string)Session["fname"]; string lname = (string)Session["lname"]; if (current_page > 1) { int row_str = (current_page - 1) * 20; link_Previous.Enabled = true; cust_mng = new Customers_Manager(); List <Customers> list_cust = cust_mng.getCustomers(idcard, fname, lname, row_str, 20); Session["row_str"] = row_str; Session["List_Customers"] = list_cust; } else { link_Previous.Enabled = false; List <Customers> list_cust = cust_mng.getCustomers(idcard, fname, lname, 0, 20); Session["row_str"] = 0; Session["List_Customers"] = list_cust; } int max_page = (int)Session["max_page"]; if (current_page == max_page) { link_Next.Enabled = false; } }
protected void Upload_Btn_Click(object sender, EventArgs e) { ctm = (Customers)Session["Customer"]; string server_path = Server.MapPath("/"); /* Create Main Folder for Detected Images of Contact Leasing */ string mainDirectory = ctm.Cust_id; string mainDirectoryPath = server_path + "\\Uploaded_Images\\" + mainDirectory; if (!Directory.Exists(mainDirectoryPath)) { Directory.CreateDirectory(mainDirectoryPath); } /* Create Sub Folder for Save Images of Car */ string subDirectory = "Home_Images"; string subDirectoryPath = mainDirectoryPath + "\\" + subDirectory; if (!Directory.Exists(subDirectoryPath)) { Directory.CreateDirectory(subDirectoryPath); } /* Get File From TextFile */ HttpFileCollection uploadedFiles = Request.Files; for (int i = 0; i < uploadedFiles.Count; i++) { HttpPostedFile userPostedFile = uploadedFiles[i]; try { if (userPostedFile.ContentLength > 0) { ctm_mng = new Customers_Manager(); string number_img = ctm_mng.getLastNumberPhotoId(ctm.Cust_id); string digit = ctm_mng.generateDigitID(); string old_name = userPostedFile.FileName; string new_name = number_img + "_" + ctm.Cust_id + "_" + digit + Path.GetExtension(userPostedFile.FileName); string db_path = "../Uploaded_Images/" + mainDirectory + "/" + subDirectory + "/" + new_name; string db_full_path = subDirectoryPath.Replace('\\', '/') + "/" + new_name; string db_local_path = subDirectoryPath + "\\" + new_name; userPostedFile.SaveAs(subDirectoryPath + "\\" + Path.GetFileName(old_name).Replace(old_name, new_name)); Customers_Home_Photo ctm_photo = new Customers_Home_Photo(); ctm_photo.Cust_id = ctm.Cust_id; ctm_photo.Home_img_num = Convert.ToInt32(number_img); ctm_photo.Home_img_old_name = old_name; ctm_photo.Home_img_path = db_path; ctm_photo.Home_img_full_path = db_full_path; ctm_photo.Home_img_local_path = db_local_path; ctm_mng.addCustomersHomePhoto(ctm_photo); /// Acticity Logs System /// package_login = (Base_Companys)Session["Package"]; acc_lgn = (Account_Login)Session["Login"]; string message = Messages_Logs._messageLogsNormal(acc_lgn.Account_F_name, " เพิ่มรูปบ้าน", acc_lgn.resu, package_login.Company_N_name); new Activity_Log_Manager().addActivityLogs(message, acc_lgn.Account_id, package_login.Company_id); /// Acticity Logs System } } catch (Exception ex) { Session["Uploaded"] = 0; string error = "ไม่สามารถ Upload รูปภาพนี้ได้ "; Log_Error._writeErrorFile(error, ex); } } Session["Uploaded"] = 1; _GetHomePhoto(); }
/******************************************************************************************************************************************************************************* **************************************************** Edit Data Function ******************************************************** **************************************************** ******************************************************** *******************************************************************************************************************************************************************************/ private void _EditCustomer() { Customers_Manager ctm_mng = new Customers_Manager(); Customers ctm = new Customers(); Customers ctm_tmp = (Customers)Session["Customer"]; ctm.Cust_id = ctm_tmp.Cust_id; ctm.Cust_Idcard = string.IsNullOrEmpty(Cust_idcard_TBx.Text) ? "" : Cust_idcard_TBx.Text; ctm.Cust_Fname = string.IsNullOrEmpty(Cust_Fname_TBx.Text) ? "" : Cust_Fname_TBx.Text; ctm.Cust_LName = string.IsNullOrEmpty(Cust_LName_TBx.Text) ? "" : Cust_LName_TBx.Text; ctm.Cust_B_date = string.IsNullOrEmpty(Cust_B_date_TBx.Text) ? null : DateTimeUtility.convertDateToMYSQL(Cust_B_date_TBx.Text); ctm.Cust_Age = string.IsNullOrEmpty(Cust_B_date_TBx.Text) ? 0 : DateTime.Now.Year - (Convert.ToInt32(Cust_B_date_TBx.Text.Split('/')[2].ToString()) - 543); ctm.Cust_Idcard_without = string.IsNullOrEmpty(Cust_Idcard_without_TBx.Text) ? "" : Cust_Idcard_without_TBx.Text; ctm.Cust_Idcard_start = string.IsNullOrEmpty(Cust_Idcard_start_TBx.Text) ? null : DateTimeUtility.convertDateToMYSQL(Cust_Idcard_start_TBx.Text); ctm.Cust_Idcard_expire = string.IsNullOrEmpty(Cust_Idcard_expire_TBx.Text) ? null : DateTimeUtility.convertDateToMYSQL(Cust_Idcard_expire_TBx.Text); ctm.ctm_ntnlt = new Base_Nationalitys(); ctm.ctm_ntnlt.Nationality_id = Cust_Nationality_DDL.SelectedIndex <= 0 ? 1 : Convert.ToInt32(Cust_Nationality_DDL.SelectedValue); ctm.ctm_org = new Base_Origins(); ctm.ctm_org.Origin_id = Cust_Origin_DDL.SelectedIndex <= 0 ? 1 : Convert.ToInt32(Cust_Origin_DDL.SelectedValue); ctm.Cust_Tel = string.IsNullOrEmpty(Cust_Tel_TBx.Text) ? "" : Cust_Tel_TBx.Text; ctm.Cust_Email = string.IsNullOrEmpty(Cust_Email_TBx.Text) ? "" : Cust_Email_TBx.Text; ctm.Cust_Job = string.IsNullOrEmpty(Cust_job_TBx.Text) ? "" : Cust_job_TBx.Text; ctm.Cust_Job_position = string.IsNullOrEmpty(Cust_job_position_TBx.Text) ? "" : Cust_job_position_TBx.Text; ctm.Cust_Job_long = string.IsNullOrEmpty(Cust_job_long_TBx.Text) ? 0 : Convert.ToInt32(Cust_job_long_TBx.Text); ctm.Cust_Job_local_name = string.IsNullOrEmpty(Cust_job_local_name_TBx.Text) ? "" : Cust_job_local_name_TBx.Text; ctm.Cust_Job_address_no = string.IsNullOrEmpty(Cust_job_address_no_TBx.Text) ? "" : Cust_job_address_no_TBx.Text; ctm.Cust_Job_vilage = string.IsNullOrEmpty(Cust_job_vilage_TBx.Text) ? "บ.-" : "บ." + Cust_job_vilage_TBx.Text; ctm.Cust_Job_vilage_no = string.IsNullOrEmpty(Cust_job_vilage_no_TBx.Text) ? "ม.-." : "ม." + Cust_job_vilage_no_TBx.Text; ctm.Cust_Job_alley = string.IsNullOrEmpty(Cust_job_alley_TBx.Text) ? "ซ.-" : "ซ." + Cust_job_alley_TBx.Text; ctm.Cust_Job_road = string.IsNullOrEmpty(Cust_job_road_TBx.Text) ? "ถ.-" : "ถ." + Cust_job_road_TBx.Text; ctm.Cust_Job_subdistrict = string.IsNullOrEmpty(Cust_job_subdistrict_TBx.Text) ? "ต.-" : "ต." + Cust_job_subdistrict_TBx.Text; ctm.Cust_Job_district = string.IsNullOrEmpty(Cust_job_district_TBx.Text) ? "อ.-" : "อ." + Cust_job_district_TBx.Text; ctm.Cust_Job_province = Cust_job_province_DDL.SelectedIndex <= 0 ? "จ.-" : "จ." + Cust_job_province_DDL.SelectedItem.Text; ctm.Cust_Job_country = string.IsNullOrEmpty(Cust_job_contry_TBx.Text) ? "" : Cust_job_contry_TBx.Text; ctm.Cust_Job_zipcode = string.IsNullOrEmpty(Cust_job_zipcode_TBx.Text) ? "" : Cust_job_zipcode_TBx.Text; ctm.Cust_Job_tel = string.IsNullOrEmpty(Cust_job_tel_TBx.Text) ? "" : Cust_job_tel_TBx.Text; ctm.Cust_Job_email = string.IsNullOrEmpty(Cust_job_email_TBx.Text) ? "" : Cust_job_email_TBx.Text; ctm.Cust_Job_salary = string.IsNullOrEmpty(Cust_job_salary_TBx.Text) ? 0 : Convert.ToDouble(Cust_job_salary_TBx.Text); ctm.ctm_pstt = new Base_Person_Status(); ctm.ctm_pstt.person_status_id = Cust_status_DDL.SelectedIndex <= 0 ? 1 : Convert.ToInt32(Cust_status_DDL.SelectedValue); ctm.Cust_Marry_idcard = string.IsNullOrEmpty(Marry_idcard_TBx.Text) ? "" : Marry_idcard_TBx.Text; ctm.Cust_Marry_Fname = string.IsNullOrEmpty(Marry_Fname_TBx.Text) ? "" : Marry_Fname_TBx.Text; ctm.Cust_Marry_Lname = string.IsNullOrEmpty(Marry_Lname_TBx.Text) ? "" : Marry_Lname_TBx.Text; ctm.ctm_marry_ntnlt = new Base_Nationalitys(); ctm.ctm_marry_ntnlt.Nationality_id = Marry_Nationality_DDL.SelectedIndex <= 0 ? 1 : Convert.ToInt32(Marry_Nationality_DDL.SelectedValue); ctm.ctm_marry_org = new Base_Origins(); ctm.ctm_marry_org.Origin_id = Marry_Origin_DDL.SelectedIndex <= 0 ? 1 : Convert.ToInt32(Marry_Origin_DDL.SelectedValue); ctm.Cust_Marry_Address_no = string.IsNullOrEmpty(Marry_address_no_TBx.Text) ? "" : Marry_address_no_TBx.Text; ctm.Cust_Marry_vilage = string.IsNullOrEmpty(Marry_vilage_TBx.Text) ? "บ.-" : "บ." + Marry_vilage_TBx.Text; ctm.Cust_Marry_vilage_no = string.IsNullOrEmpty(Marry_vilage_no_TBx.Text) ? "ม.-" : "ม." + Marry_vilage_no_TBx.Text; ctm.Cust_Marry_alley = string.IsNullOrEmpty(Marry_alley_TBx.Text) ? "ซ.-" : "ซ." + Marry_alley_TBx.Text; ctm.Cust_Marry_road = string.IsNullOrEmpty(Marry_road_TBx.Text) ? "ถ.-" : "ถ." + Marry_road_TBx.Text; ctm.Cust_Marry_subdistrict = string.IsNullOrEmpty(Marry_subdistrict_TBx.Text) ? "ต.-" : "ต." + Marry_subdistrict_TBx.Text; ctm.Cust_Marry_district = string.IsNullOrEmpty(Marry_district_TBx.Text) ? "อ.-" : "อ." + Marry_district_TBx.Text; ctm.Cust_Marry_province = Marry_province_DDL.SelectedIndex <= 0 ? "จ.-" : "จ." + Marry_province_DDL.SelectedItem.Text; ctm.Cust_Marry_country = string.IsNullOrEmpty(Marry_country_TBx.Text) ? "" : Marry_country_TBx.Text; ctm.Cust_Marry_zipcode = string.IsNullOrEmpty(Marry_zipcode_TBx.Text) ? "" : Marry_zipcode_TBx.Text; ctm.Cust_Marry_job = string.IsNullOrEmpty(Marry_job_TBx.Text) ? "" : Marry_job_TBx.Text; ctm.Cust_Marry_job_position = string.IsNullOrEmpty(Marry_job_position_TBx.Text) ? "" : Marry_job_position_TBx.Text; ctm.Cust_Marry_job_long = string.IsNullOrEmpty(Marry_job_long_TBx.Text) ? 0 : Convert.ToInt32(Marry_job_long_TBx.Text); ctm.Cust_Marry_job_salary = string.IsNullOrEmpty(Marry_job_salary_TBx.Text) ? 0 : Convert.ToDouble(Marry_job_salary_TBx.Text); ctm.Cust_Marry_job_local_name = string.IsNullOrEmpty(Marry_job_local_name_TBx.Text) ? "" : Marry_job_local_name_TBx.Text; ctm.Cust_Marry_job_address_no = string.IsNullOrEmpty(Marry_job_address_no_TBx.Text) ? "" : Marry_job_address_no_TBx.Text; ctm.Cust_Marry_job_vilage = string.IsNullOrEmpty(Marry_job_vilage_TBx.Text) ? "บ.-" : "บ." + Marry_job_vilage_TBx.Text; ctm.Cust_Marry_job_vilage_no = string.IsNullOrEmpty(Marry_job_vilage_no_TBx.Text) ? "ม.-" : "ม." + Marry_job_vilage_no_TBx.Text; ctm.Cust_Marry_job_alley = string.IsNullOrEmpty(Marry_job_alley_TBx.Text) ? "ซ.-" : "ซ." + Marry_job_alley_TBx.Text; ctm.Cust_Marry_job_road = string.IsNullOrEmpty(Marry_job_road_TBx.Text) ? "ถ.-" : "ถ." + Marry_job_road_TBx.Text; ctm.Cust_Marry_job_subdistrict = string.IsNullOrEmpty(Marry_job_subdistrict_TBx.Text) ? "ต.-" : "ต." + Marry_job_subdistrict_TBx.Text; ctm.Cust_Marry_job_district = string.IsNullOrEmpty(Marry_job_district_TBx.Text) ? "อ.-" : "อ." + Marry_job_district_TBx.Text; ctm.Cust_Marry_job_province = Marry_job_province_DDL.SelectedIndex <= 0 ? "จ.-" : "จ." + Marry_job_province_DDL.SelectedItem.Text; ctm.Cust_Marry_job_country = string.IsNullOrEmpty(Marry_job_country_TBx.Text) ? "" : Marry_job_country_TBx.Text; ctm.Cust_Marry_job_zipcode = string.IsNullOrEmpty(Marry_job_zipcode_TBx.Text) ? "" : Marry_job_zipcode_TBx.Text; ctm.Cust_Marry_job_tel = string.IsNullOrEmpty(Marry_job_tel_TBx.Text) ? "" : Marry_job_tel_TBx.Text; ctm.Cust_Marry_tel = string.IsNullOrEmpty(Marry_tel_TBx.Text) ? "" : Marry_tel_TBx.Text; ctm.Cust_Marry_email = string.IsNullOrEmpty(Marry_email_TBx.Text) ? "" : Marry_email_TBx.Text; ctm.Cust_Home_address_no = string.IsNullOrEmpty(Home_Cust_Address_no_TBx.Text) ? "" : Home_Cust_Address_no_TBx.Text; ctm.Cust_Home_vilage = string.IsNullOrEmpty(Home_Cust_Vilage_TBx.Text) ? "บ.-" : "บ." + Home_Cust_Vilage_TBx.Text; ctm.Cust_Home_vilage_no = string.IsNullOrEmpty(Home_Cust_Vilage_no_TBx.Text) ? "ม.-" : "ม." + Home_Cust_Vilage_no_TBx.Text; ctm.Cust_Home_alley = string.IsNullOrEmpty(Home_Cust_Alley_TBx.Text) ? "ซ.-" : "ซ." + Home_Cust_Alley_TBx.Text; ctm.Cust_Home_road = string.IsNullOrEmpty(Home_Cust_Road_TBx.Text) ? "ถ.-" : "ถ." + Home_Cust_Road_TBx.Text; ctm.Cust_Home_subdistrict = string.IsNullOrEmpty(Home_Cust_Subdistrict_TBx.Text) ? "ต.-" : "ต." + Home_Cust_Subdistrict_TBx.Text; ctm.Cust_Home_district = string.IsNullOrEmpty(Home_Cust_District_TBx.Text) ? "อ.-" : "อ." + Home_Cust_District_TBx.Text; ctm.Cust_Home_province = Home_Cust_Province_DDL.SelectedIndex <= 0 ? "จ.-" : "จ." + Home_Cust_Province_DDL.SelectedItem.Text; ctm.Cust_Home_country = string.IsNullOrEmpty(Home_Cust_Country_TBx.Text) ? "" : Home_Cust_Country_TBx.Text; ctm.Cust_Home_zipcode = string.IsNullOrEmpty(Home_Cust_Zipcode_TBx.Text) ? "" : Home_Cust_Zipcode_TBx.Text; ctm.Cust_Home_tel = string.IsNullOrEmpty(Home_Cust_Tel_TBx.Text) ? "" : Home_Cust_Tel_TBx.Text; ctm.ctm_home_stt = new Base_Home_Status(); ctm.ctm_home_stt.Home_status_id = Home_Cust_Home_status_id_DDL.SelectedIndex <= 0 ? 1 : Convert.ToInt32(Home_Cust_Home_status_id_DDL.SelectedValue); ctm.Cust_Home_GPS_Latitude = string.IsNullOrEmpty(Home_Cust_Gps_Latitude_TBx.Text) ? "" : Home_Cust_Gps_Latitude_TBx.Text; ctm.Cust_Home_GPS_Longitude = string.IsNullOrEmpty(Home_Cust_Gps_Longitude_TBx.Text) ? "" : Home_Cust_Gps_Longitude_TBx.Text; ctm.Cust_Idcard_address_no = string.IsNullOrEmpty(Idcard_Cust_Address_no_TBx.Text) ? "" : Idcard_Cust_Address_no_TBx.Text; ctm.Cust_Idcard_vilage = string.IsNullOrEmpty(Idcard_Cust_Vilage_TBx.Text) ? "บ.-" : "บ." + Idcard_Cust_Vilage_TBx.Text; ctm.Cust_Idcard_vilage_no = string.IsNullOrEmpty(Idcard_Cust_Vilage_no_TBx.Text) ? "ม.-" : "ม." + Idcard_Cust_Vilage_no_TBx.Text; ctm.Cust_Idcard_alley = string.IsNullOrEmpty(Idcard_Cust_Alley_TBx.Text) ? "ซ.-" : "ซ." + Idcard_Cust_Alley_TBx.Text; ctm.Cust_Idcard_road = string.IsNullOrEmpty(Idcard_Cust_Road_TBx.Text) ? "ถ.-" : "ถ." + Idcard_Cust_Road_TBx.Text; ctm.Cust_Idcard_subdistrict = string.IsNullOrEmpty(Idcard_Cust_Subdistrict_TBx.Text) ? "ต.-" : "ต." + Idcard_Cust_Subdistrict_TBx.Text; ctm.Cust_Idcard_district = string.IsNullOrEmpty(Idcard_Cust_District_TBx.Text) ? "อ.-" : "อ." + Idcard_Cust_District_TBx.Text; ctm.Cust_Idcard_province = Idcard_Cust_Province_DDL.SelectedIndex <= 0 ? "จ.-" : "จ." + Idcard_Cust_Province_DDL.SelectedItem.Text; ctm.Cust_Idcard_country = string.IsNullOrEmpty(Idcard_Cust_Country_TBx.Text) ? "" : Idcard_Cust_Country_TBx.Text; ctm.Cust_Idcard_zipcode = string.IsNullOrEmpty(Idcard_Cust_Zipcode_TBx.Text) ? "" : Idcard_Cust_Zipcode_TBx.Text; ctm.Cust_Idcard_tel = string.IsNullOrEmpty(Idcard_Cust_Tel_TBx.Text) ? "" : Idcard_Cust_Tel_TBx.Text; ctm.ctm_idcard_stt = new Base_Home_Status(); ctm.ctm_idcard_stt.Home_status_id = Idcard_Cust_Home_status_DDL.SelectedIndex <= 0 ? 1 : Convert.ToInt32(Idcard_Cust_Home_status_DDL.SelectedValue); ctm.Cust_Current_address_no = string.IsNullOrEmpty(Current_Cust_Address_no_TBx.Text) ? "" : Current_Cust_Address_no_TBx.Text; ctm.Cust_Current_vilage = string.IsNullOrEmpty(Current_Cust_Vilage_TBx.Text) ? "บ.-" : "บ." + Current_Cust_Vilage_TBx.Text; ctm.Cust_Current_vilage_no = string.IsNullOrEmpty(Current_Cust_Vilage_no_TBx.Text) ? "ม.-" : "ม." + Current_Cust_Vilage_no_TBx.Text; ctm.Cust_Current_alley = string.IsNullOrEmpty(Current_Cust_Alley_TBx.Text) ? "ซ.-" : "ซ." + Current_Cust_Alley_TBx.Text; ctm.Cust_Current_road = string.IsNullOrEmpty(Current_Cust_Road_TBx.Text) ? "ถ.-" : "ถ." + Current_Cust_Road_TBx.Text; ctm.Cust_Current_subdistrict = string.IsNullOrEmpty(Current_Cust_Subdistrict_TBx.Text) ? "ต.-" : "ต." + Current_Cust_Subdistrict_TBx.Text; ctm.Cust_Current_district = string.IsNullOrEmpty(Current_Cust_District_TBx.Text) ? "อ.-" : "อ." + Current_Cust_District_TBx.Text; ctm.Cust_Current_province = Current_Cust_Province_DDL.SelectedIndex <= 0 ? "จ.-" : "จ." + Current_Cust_Province_DDL.SelectedItem.Text; ctm.Cust_Current_country = string.IsNullOrEmpty(Current_Cust_Country_TBx.Text) ? "" : Current_Cust_Country_TBx.Text; ctm.Cust_Current_zipcode = string.IsNullOrEmpty(Current_Cust_Zipcode_TBx.Text) ? "" : Current_Cust_Zipcode_TBx.Text; ctm.Cust_Current_tel = string.IsNullOrEmpty(Current_Cust_Tel_TBx.Text) ? "" : Current_Cust_Tel_TBx.Text; ctm.ctm_current_stt = new Base_Home_Status(); ctm.ctm_current_stt.Home_status_id = Current_Cust_Home_status_id_DDL.SelectedIndex <= 0 ? 1 : Convert.ToInt32(Current_Cust_Home_status_id_DDL.SelectedValue); Session["Customer"] = ctm; if (ctm_mng.editCustomers(ctm)) { /// Acticity Logs System /// package_login = (Base_Companys)Session["Package"]; acc_lgn = (Account_Login)Session["Login"]; string message = Messages_Logs._messageLogsNormal(acc_lgn.Account_F_name, " แก้ไขข้อมูลผู้ติดต่อ", acc_lgn.resu, package_login.Company_N_name); new Activity_Log_Manager().addActivityLogs(message, acc_lgn.Account_id, package_login.Company_id); /// Acticity Logs System Session.Remove("chk_customer"); Session["Class_Active_Customer"] = 2; Response.Redirect("/Form_Customer/Customer_Home_Photo"); } else { Alert_Danger_Panel.Visible = true; alert_header_danger_Lbl.Text = "แจ้งเตือน!!"; alert_danger_Lbl.Text = "กรุณาตรวจสอบ ข้อมูลอีกครั้ง"; Alert_Danger_Panel.Focus(); } }