private bool SaveData() { if (!IsValidate()) { return(false); } string Message = string.Empty; #region Check Post Curiar if (chkIsPost.Checked) { var dtCourier = new Courier() { OrganizationId = lblOrganizationId.zToInt(), IsPost = (int)eYesNo.Yes, }.Select(); if (dtCourier.Rows.Count > 0) { var lstUpdateCourier = new List <Courier>(); foreach (DataRow drCourier in dtCourier.Rows) { lstUpdateCourier.Add(new Courier() { CourierId = drCourier[CS.CourierId].zToInt(), IsPost = (int)eYesNo.No }); } lstUpdateCourier.Update(); } } #endregion var objCourier = new Courier() { OrganizationId = lblOrganizationId.zToInt(), SerialNo = txtSerialNo.zToInt(), CarrierCode = txtCarrierCode.Text, CourierName = txtCourierName.Text.Trim().zFirstCharToUpper(), CODTrackingURL = txtCODTrackingURL.Text, PrepaidTrackingURL = txtPrepaidTrackingURL.Text, IsPost = chkIsPost.Checked ? (int)eYesNo.Yes : (int)eYesNo.No, }; if (IsEditMode()) { objCourier.CourierId = lblCourierId.zToInt(); objCourier.Update(); Message = "Courier Detail Change Sucessfully."; } else { objCourier.eStatus = (int)eStatus.Active; objCourier.Insert(); Message = "New Courier Added Sucessfully."; } CU.ZMessage(eMsgType.Success, string.Empty, Message); return(true); }