private bool SaveData() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblCategory", tblCategory.ColumnNames.AppCategory, tblCategory.ColumnNames.AppCategoryID, txtCategoryName.Text, hdnPKID.Value)) { DInfo.ShowMessage("Category Name alredy exits.", Enums.MessageType.Error); return(false); } objCategory = new tblCategory(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objCategory.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objCategory.AddNew(); objCategory.s_AppCreatedBy = Session[appFunctions.Session.UserID.ToString()].ToString(); objCategory.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblCategory", tblCategory.ColumnNames.AppDisplayOrder); // objCategory.s_AppCreatedDate = FormatDateString(DateTime.Now.ToString(strInputDateFormat), strInputDateFormat, strOutputDateFormat); objCategory.AppCreatedDate = DateTime.Now; } objCategory.AppCategory = txtCategoryName.Text; objCategory.AppIsActive = chkIsActive.Checked; objCategory.Save(); intPkId = objCategory.AppCategoryID; objCategory = null; objCommon = null; return(true); }
private bool SaveData() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblDeal", tblDeal.ColumnNames.AppProductID, tblDeal.ColumnNames.AppDealID, ddlProduct.SelectedValue, hdnPKID.Value)) { DInfo.ShowMessage("Deal with this product already exists", Enums.MessageType.Error); return(false); } objDeal = new tblDeal(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objDeal.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objDeal.AddNew(); objDeal.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblDeal", tblDeal.ColumnNames.AppDisplayOrder); } objDeal.s_AppProductID = ddlProduct.SelectedValue; objDeal.AppTitle = txtTitle.Text; objDeal.AppDescription = txtDescription.Text; objDeal.AppDiscountPer = Convert.ToDecimal(txtDiscount.Text); objDeal.AppIsActive = chkIsActive.Checked; objDeal.Save(); intPkId = objDeal.AppDealID; objDeal = null; objCommon = null; return(true); }
private bool SaveData() { objClsCommon = new clsCommon(); if (objClsCommon.IsRecordExists("tblMenuItemType", tblMenuItemType.ColumnNames.AppMenuItemType, tblMenuItemType.ColumnNames.AppMenuItemTypeID, txtMenuItemType.Text.Trim(), hdnPKID.Value)) { DInfo.ShowMessage("Menu iten type is already exists", Enums.MessageType.Warning); return(false); } objMenuItemType = new tblMenuItemType(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objMenuItemType.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objMenuItemType.AddNew(); objMenuItemType.AppDisplayOrder = objClsCommon.GetNextDisplayOrder("tblMenuItemType", tblMenuItemType.ColumnNames.AppDisplayOrder); objMenuItemType.AppCreateDate = System.DateTime.Now; objMenuItemType.AppCreateBy = Convert.ToInt32(Session[appFunctions.Session.UserID.ToString()]); } objMenuItemType.s_AppMenuItemType = txtMenuItemType.Text; objMenuItemType.AppIsActive = chkIsActive.Checked; objMenuItemType.Save(); iMenuItemTypeid = objMenuItemType.AppMenuItemTypeID; objMenuItemType = null; objClsCommon = null; return(true); }
private bool SaveData() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblState", tblState.ColumnNames.AppState, tblState.ColumnNames.AppStateID, txtState.Text, hdnPKID.Value)) { DInfo.ShowMessage(" State already exits.", Enums.MessageType.Error); return(false); } objCommon = null; objState = new tblState(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objState.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objState.AddNew(); } objState.AppState = txtState.Text; objState.s_AppCountryID = ddlCountry.SelectedValue.ToString(); objState.Save(); iStateID = objState.AppStateID; objState = null; return(true); }
private bool SaveData() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblCourierCompany", tblCourierCompany.ColumnNames.AppCourierCompany, tblCourierCompany.ColumnNames.AppCourierCompanyID, txtCourierCompanyName.Text, hdnPKID.Value)) { DInfo.ShowMessage("Courier Company Name alredy exits.", Enums.MessageType.Error); return(false); } objCourierCompany = new tblCourierCompany(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objCourierCompany.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objCourierCompany.AddNew(); objCourierCompany.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblCourierCompany", tblCourierCompany.ColumnNames.AppDisplayOrder); } objCourierCompany.AppCourierCompany = txtCourierCompanyName.Text; objCourierCompany.s_AppCODRate = txtCODRate.Text; objCourierCompany.AppEmail = txtEmail.Text; objCourierCompany.AppContactNo = txtContactNo.Text; objCourierCompany.AppWebsite = txtWebsite.Text; objCourierCompany.AppIsActive = chkIsActive.Checked; objCourierCompany.Save(); iCourierCompanyID = objCourierCompany.AppCourierCompanyID; objCourierCompany = null; objCommon = null; return(true); }
private bool SaveData() { objClsCommon = new clsCommon(); if (objClsCommon.IsRecordExists("tblMenuType", tblMenuType.ColumnNames.AppMenuTypeName, tblMenuType.ColumnNames.AppMenuTypeId, txtMenuTypeName.Text, hdnPKID.Value)) { DInfo.ShowMessage("MenuType Name already exists.", Enums.MessageType.Error); return(false); } objClsCommon = null; objMenuType = new tblMenuType(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objMenuType.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objMenuType.AddNew(); objMenuType.AppCreatedDate = System.DateTime.Now; objMenuType.AppCreatedBy = Convert.ToInt32(Session[appFunctions.Session.UserID.ToString()]); } objMenuType.AppMenuTypeName = txtMenuTypeName.Text; objMenuType.s_AppNoOfLevel = txtNoLevel.Text; objMenuType.AppIsActive = ChkIsActive.Checked; objMenuType.s_AppBlockId = ddlBlock.SelectedValue; objMenuType.Save(); iMenuTypeid = objMenuType.AppMenuTypeId; objMenuType = null; objClsCommon = null; return(true); }
private bool SaveData() { objClsCommon = new clsCommon(); objPinCode = new tblPinCode(); if (objClsCommon.IsRecordExists("tblPinCode", tblPinCode.ColumnNames.AppPinCode, tblPinCode.ColumnNames.AppPinCodeID, txtPINCode.Text, hdnPKID.Value)) { DInfo.ShowMessage(" Pin Code already exits.", Enums.MessageType.Error); return(false); } if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objPinCode.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objPinCode.AddNew(); } objPinCode.AppPinCode = Convert.ToInt32(txtPINCode.Text); objPinCode.s_AppCityID = ddlCity.SelectedValue.ToString(); objPinCode.AppIsActive = chkIsActive.Checked; objPinCode.Save(); iBrandID = objPinCode.AppPinCodeID; objPinCode = null; objClsCommon = null; return(true); }
private bool SaveData() { objClsCommon = new clsCommon(); objCountry = new tblCountry(); if (objClsCommon.IsRecordExists("tblCountry", tblCountry.ColumnNames.AppCountry, tblCountry.ColumnNames.AppCountryID, txtCountry.Text, hdnPKID.Value)) { DInfo.ShowMessage(" Country already exits.", Enums.MessageType.Error); return(false); } if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objCountry.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objCountry.AddNew(); } objCountry.AppCountry = txtCountry.Text; //objCountry.AppIsActive = chkIsActive.Checked; objCountry.Save(); iCountryID = objCountry.AppCountryID; objCountry = null; objClsCommon = null; return(true); }
public bool SaveFavouriteProduct() { if (hdnPKID.Value != "") { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblFavouriteProduct", tblFavouriteProduct.ColumnNames.AppProductID, tblFavouriteProduct.ColumnNames.AppFavouriteProductID, hdnPKID.Value, "", tblFavouriteProduct.ColumnNames.AppCustomerID + "=" + Session[appFunctions.Session.ClientUserID.ToString()].ToString())) { DInfo.ShowMessage("This product already exists in favourite.", Enums.MessageType.Error); //ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", "<SCRIPT LANGUAGE='javascript'>alert('Product alredy exits in Favourite List');</script>", false); return(false); } objCommon = null; tblFavouriteProduct objFavouriteProduct = new tblFavouriteProduct(); objFavouriteProduct.AddNew(); objFavouriteProduct.s_AppProductID = hdnPKID.Value; objFavouriteProduct.s_AppCustomerID = Session[appFunctions.Session.ClientUserID.ToString()].ToString(); objFavouriteProduct.s_AppCreatedDate = FormatDateString(DateTime.Now.ToString(strInputDateFormat), strInputDateFormat, strOutputDateFormat); objFavouriteProduct.Save(); objFavouriteProduct = null; return(true); } else { return(false); } }
private bool SaveData() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblCouponCode", tblCouponCode.ColumnNames.AppCouponCode, tblCouponCode.ColumnNames.AppCouponCodeID, txtCouponCode.Text, hdnPKID.Value)) { DInfo.ShowMessage("Coupon Code alredy exits.", Enums.MessageType.Error); return(false); } objCouponCode = new tblCouponCode(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objCouponCode.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objCouponCode.AddNew(); } objCouponCode.AppCouponCode = txtCouponCode.Text; objCouponCode.s_AppDiscountPer = txtDiscountPer.Text; objCouponCode.s_AppStartDate = txtStartDate.Text; objCouponCode.s_AppEndDate = txtEndDate.Text; objCouponCode.AppIsActive = chkIsActive.Checked; objCouponCode.s_AppType = ddlType.SelectedValue; objCouponCode.Save(); intPkId = objCouponCode.AppCouponCodeID; objCouponCode = null; objCommon = null; return(true); }
private bool SaveData() { objClsCommon = new clsCommon(); objUser = new tblUser(); if (objClsCommon.IsRecordExists("tblUser", tblUser.ColumnNames.AppUserName, tblUser.ColumnNames.AppUserId, txtUserName.Text, hdnPKID.Value)) { DInfo.ShowMessage("User Name is already exists", Enums.MessageType.Warning); return(false); } if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objUser.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objUser.AddNew(); objUser.AppCreatedDate = System.DateTime.Now; objUser.AppCreatedBy = Convert.ToInt32(Session[appFunctions.Session.UserID.ToString()]); } objUser.s_AppUserName = txtUserName.Text; objEncrypt = new clsEncryption(); objUser.AppPassword = objEncrypt.Encrypt(txtPassword.Text, appFunctions.strKey); objEncrypt = null; objUser.s_AppRoleId = ddlRoleName.SelectedValue; objUser.AppFullName = txtFullName.Text; objUser.AppEmail = txtEmailAddress.Text; objUser.AppMobile = txtMobileNo.Text; objUser.AppAddress = txtAddress.Text; objUser.AppIsActive = chkIsActive.Checked; objUser.AppIsSuperAdmin = Convert.ToBoolean(0); if (FileUploadImg.HasFile) { objClsCommon = new clsCommon(); string strError = ""; string Time = Convert.ToString(DateTime.Now.Month) + Convert.ToString(DateTime.Now.Day) + Convert.ToString(DateTime.Now.Year) + Convert.ToString(DateTime.Now.Hour) + Convert.ToString(DateTime.Now.Minute) + Convert.ToString(DateTime.Now.Second); string strPath = objClsCommon.FileUpload_Images(FileUploadImg.PostedFile, txtFullName.Text.Trim().Replace(" ", "_") + "_" + Time, "Uploads/User/", ref strError, 0, objUser.s_AppPhoto); if (strError == "") { objUser.AppPhoto = strPath; } else { DInfo.ShowMessage(strError, Enums.MessageType.Error); return(false); } } objUser.AppDescription = txtDescription.Text; objUser.Save(); iUserid = objUser.AppUserId; objUser = null; objClsCommon = null; return(true); }
private bool SaveData() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblProperty", tblProperty.ColumnNames.AppPropertyName, tblProperty.ColumnNames.AppPropertyID, txtPropertyName.Text, hdnPKID.Value)) { DInfo.ShowMessage("Property Name alredy exits.", Enums.MessageType.Error); return(false); } if (objCommon.IsRecordExists("tblProperty", tblProperty.ColumnNames.AppDisplayName, tblProperty.ColumnNames.AppPropertyID, txtDisplayName.Text, hdnPKID.Value)) { DInfo.ShowMessage("Display Name alredy exits.", Enums.MessageType.Error); return(false); } objProperty = new tblProperty(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objProperty.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objProperty.AddNew(); objProperty.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblProperty", tblProperty.ColumnNames.AppDisplayOrder); objProperty.s_AppCreatedBy = Session[appFunctions.Session.UserID.ToString()].ToString(); objProperty.AppCreatedDate = DateTime.Now; // objBanner.AppDisplayOrder = objClsCommon.GetNextDisplayOrder("tblBanner", tblBanner.ColumnNames.AppDisplayOrder); } objProperty.AppPropertyName = txtPropertyName.Text; objProperty.AppDisplayName = txtDisplayName.Text; objProperty.AppDescription = txtDescription.Text; objProperty.AppIsPredefine = chkIsPredefine.Checked; objProperty.AppIsShowInSearch = ChkIsShowInSearch.Checked; objProperty.Save(); intPkId = objProperty.AppPropertyID; objProperty = null; objCommon = null; return(true); }
private bool SaveData() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblSize", tblSize.ColumnNames.AppSize, tblSize.ColumnNames.AppSizeID, txtSize.Text, hdnPKID.Value)) { DInfo.ShowMessage("Size is already exists", Enums.MessageType.Warning); return(false); } objSize = new tblSize(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objSize.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objSize.AddNew(); } objSize.s_AppSize = txtSize.Text.Trim(); objSize.AppIsActive = chkIsActive.Checked; if (chkIsDefault.Checked) { tblSize ObjTemp = new tblSize(); ObjTemp.SetDefaultSize(); ObjTemp = null; objSize.AppIsActive = true; objSize.AppIsDefault = true; } else { tblSize ObjTemp = new tblSize(); ObjTemp.LoadAll(); if (ObjTemp.RowCount <= 0) { objSize.AppIsActive = true; objSize.AppIsDefault = true; } else { objSize.AppIsDefault = false; } ObjTemp = null; } objSize.Save(); iprojectID = objSize.AppSizeID; objSize = null; objClsCommon = null; return(true); }
private bool SaveData() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblOrderStatus", tblOrderStatus.ColumnNames.AppOrderStatus, tblOrderStatus.ColumnNames.AppOrderStatusID, txtOrderStatus.Text, hdnPKID.Value)) { DInfo.ShowMessage("Order Status alredy exits.", Enums.MessageType.Error); return(false); } objOrderStatus = new tblOrderStatus(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objOrderStatus.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objOrderStatus.AddNew(); objOrderStatus.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblOrderStatus", tblOrderStatus.ColumnNames.AppDisplayOrder); } objOrderStatus.AppOrderStatus = txtOrderStatus.Text; objOrderStatus.AppIsActive = chkIsActive.Checked; if (chkIsDefault.Checked) { tblOrderStatus ObjTempcolor = new tblOrderStatus(); ObjTempcolor.SetDefaultOrderStatus(); ObjTempcolor = null; objOrderStatus.AppIsActive = true; objOrderStatus.AppIsDefault = true; } else { tblOrderStatus ObjTempcolor = new tblOrderStatus(); ObjTempcolor.LoadAll(); if (ObjTempcolor.RowCount <= 0) { objOrderStatus.AppIsActive = true; objOrderStatus.AppIsDefault = true; } else { objOrderStatus.AppIsDefault = false; } ObjTempcolor = null; } objOrderStatus.Save(); intPkId = objOrderStatus.AppOrderStatusID; objOrderStatus = null; objCommon = null; return(true); }
private bool SaveData() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblCurrency", tblCurrency.ColumnNames.AppCurrency, tblCurrency.ColumnNames.AppCurrencyID, txtCurrencyName.Text, hdnPKID.Value)) { DInfo.ShowMessage("Currency Name alredy exits.", Enums.MessageType.Error); return(false); } objCurrency = new tblCurrency(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objCurrency.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objCurrency.AddNew(); objCurrency.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblCurrency", tblCurrency.ColumnNames.AppDisplayOrder); } objCurrency.AppCurrency = txtCurrencyName.Text; objCurrency.AppCurrencyCode = txtCurrencyCode.Text; objCurrency.s_AppRate = txtRate.Text; objCurrency.s_AppSymbol = txtSymbol.Text; objCurrency.AppIsActive = chkIsActive.Checked; if (chkIsDefault.Checked) { tblColor ObjTempcolor = new tblColor(); ObjTempcolor.SetDefaultColor(); ObjTempcolor = null; objCurrency.AppIsActive = true; objCurrency.AppIsDefault = true; } else { if (objCurrency.AppDisplayOrder == 1) { objCurrency.AppIsActive = true; objCurrency.AppIsDefault = true; } else { objCurrency.AppIsDefault = false; } } objCurrency.Save(); intPkId = objCurrency.AppCurrencyID; objCurrency = null; objCommon = null; return(true); }
public bool SaveCustomer() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblCustomer", tblCustomer.ColumnNames.AppEmailID, tblCustomer.ColumnNames.AppCustomerID, txtEmailRegistration.Text)) { DisplayInfoRegistration.ShowMessage("Email address already exist.", Enums.MessageType.Error); return(false); } objCommon = null; tblCustomer objCustomer = new tblCustomer(); objCustomer.AddNew(); objCustomer.AppFirstName = txtFirstName.Text.Trim(); objCustomer.AppLastName = txtLastName.Text.Trim(); objCustomer.AppEmailID = txtEmailRegistration.Text.Trim(); objCustomer.AppMobile = txtMobile.Text; // objCustomer.AppAddress = txtAddress.Text; if (RbtnMale.Checked) { objCustomer.AppGender = true; } else { objCustomer.AppGender = false; } objEncrypt = new clsEncryption(); objCustomer.AppPassword = objEncrypt.Encrypt(txtPasswordRegistration.Text, appFunctions.strKey); objEncrypt = null; // objCustomer.AppIsNewsLetter = ChkSubsucribNewsLetter.Checked; objCustomer.AppIsActive = true; objCustomer.AppIsVerified = false; objCustomer.AppCreatedDate = GetDateTime(); objCustomer.Save(); // tblAddress objAdress = new tblAddress(); // objAdress.AddNew(); //// objAdress.AppAddress = txtAddress.Text; // objAdress.AppCustomerID = objCustomer.AppCustomerID; // objAdress.Save(); SendMail(objCustomer.s_AppCustomerID); objCustomer = null; return(true); }
private bool SaveData() { objClsCommon = new clsCommon(); objUser = new tblUser(); if (objClsCommon.IsRecordExists("tblUser", tblUser.ColumnNames.AppEmail, tblUser.ColumnNames.AppUserId, txtEmailAddress.Text, hdnPKID.Value)) { DInfo.ShowMessage("Email Address is already exists", Enums.MessageType.Warning); return(false); } if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objUser.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } objUser.AppFullName = txtFullName.Text; objUser.AppMobile = txtMobileNo.Text; objUser.AppEmail = txtEmailAddress.Text; objUser.AppAddress = txtAddress.Text; if (FileUploadImg.HasFile) { objClsCommon = new clsCommon(); string strError = ""; string Time = Convert.ToString(DateTime.Now.Month) + Convert.ToString(DateTime.Now.Day) + Convert.ToString(DateTime.Now.Year) + Convert.ToString(DateTime.Now.Hour) + Convert.ToString(DateTime.Now.Minute) + Convert.ToString(DateTime.Now.Second); string strPath = objClsCommon.FileUpload_Images(FileUploadImg.PostedFile, txtFullName.Text.Trim().Replace(" ", "_") + "_" + Time, "Uploads/Employee/", ref strError, 0, objUser.s_AppPhoto); if (strError == "") { objUser.AppPhoto = strPath; } else { DInfo.ShowMessage(strError, Enums.MessageType.Error); return(false); } } objUser.Save(); hdnPKID.Value = objUser.AppUserId.ToString(); objUser = null; return(true); }
public bool SaveCustomer() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblCustomer", tblCustomer.ColumnNames.AppEmailID, tblCustomer.ColumnNames.AppCustomerID, txtEmailRegistration.Text)) { DisplayInfoRegistration.ShowMessage("Email address already exist.", Enums.MessageType.Error); return(false); } objCommon = null; tblCustomer objCustomer = new tblCustomer(); objCustomer.AddNew(); objCustomer.AppFirstName = txtFirstName.Text.Trim(); objCustomer.AppLastName = txtLastName.Text.Trim(); objCustomer.AppEmailID = txtEmailRegistration.Text.Trim(); objCustomer.AppMobile = txtMobile.Text; objCustomer.AppAddress = txtAddress.Text; if (RbtnMale.Checked) { objCustomer.AppGender = true; } else { objCustomer.AppGender = false; } objEncrypt = new clsEncryption(); objCustomer.AppPassword = objEncrypt.Encrypt(txtPasswordRegistration.Text, appFunctions.strKey); objEncrypt = null; objCustomer.AppIsActive = true; objCustomer.AppIsVerified = true; objCustomer.AppCreatedDate = GetDateTime(); objCustomer.Save(); HttpContext.Current.Session[appFunctions.Session.ClientUserID.ToString()] = objCustomer.AppCustomerID; HttpContext.Current.Session[appFunctions.Session.ClientUserName.ToString()] = objCustomer.AppFirstName + " " + objCustomer.AppLastName; objCustomer = null; return(true); }
private bool SavePropertyPreValueData() { if (hdnPKID.Value != "") { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblPropertyPreValue", tblPropertyPreValue.ColumnNames.AppPreValue, tblPropertyPreValue.ColumnNames.AppPropertyPreValueID, txtPreValue.Text, hdnPropertyPreValueId.Value, tblPropertyPreValue.ColumnNames.AppPropertyID + "=" + hdnPKID.Value)) { DInfoPropertyPreValue.ShowMessage("Pre-Value alredy exits.", Enums.MessageType.Error); return(false); } objPropertyPreValue = new tblPropertyPreValue(); if (!string.IsNullOrEmpty(hdnPropertyPreValueId.Value) && hdnPropertyPreValueId.Value != "") { objPropertyPreValue.LoadByPrimaryKey(Convert.ToInt32(hdnPropertyPreValueId.Value)); } else { objPropertyPreValue.AddNew(); objPropertyPreValue.s_AppCreatedBy = Session[appFunctions.Session.UserID.ToString()].ToString(); objPropertyPreValue.AppCreatedDate = DateTime.Now; objPropertyPreValue.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblPropertyPreValue", tblPropertyPreValue.ColumnNames.AppDisplayOrder, tblPropertyPreValue.ColumnNames.AppPropertyID + "=" + hdnPKID.Value); } objPropertyPreValue.s_AppPropertyID = hdnPKID.Value; objPropertyPreValue.AppPreValue = txtPreValue.Text; objPropertyPreValue.AppIsActive = chkPropertyPreValueIsActive.Checked; objPropertyPreValue.Save(); objPropertyPreValue = null; objCommon = null; return(true); } else { return(false); } }
private bool SaveCourierRateData() { if (hdnPKID.Value != "") { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblCourierRate", tblCourierRate.ColumnNames.AppPinCodeID, tblCourierRate.ColumnNames.AppCourierRateID, ddlPINCode.SelectedValue, "", tblCourierRate.ColumnNames.AppCourierCompanyID + "=" + hdnPKID.Value + " and " + tblCourierRate.ColumnNames.AppMinWeight + "=" + txtMinWeight.Text + " and " + tblCourierRate.ColumnNames.AppMaxWeight + "=" + txtMaxWeight.Text + " and " + tblCourierRate.ColumnNames.AppIsCOD + "='" + chkIsCOD.Checked + "'")) { ddlPINCode.SelectedIndex = 0; DInfoSubCategory.ShowMessage("Data for the same already exits.", Enums.MessageType.Error); return(false); } objCourierRate = new tblCourierRate(); if (!string.IsNullOrEmpty(hdnCourierRateId.Value) && hdnCourierRateId.Value != "") { objCourierRate.LoadByPrimaryKey(Convert.ToInt32(hdnCourierRateId.Value)); } else { objCourierRate.AddNew(); } objCourierRate.AppPinCodeID = Convert.ToInt32(ddlPINCode.SelectedValue.ToString()); objCourierRate.s_AppCourierCompanyID = hdnPKID.Value; objCourierRate.s_AppMinWeight = txtMinWeight.Text; objCourierRate.s_AppMaxWeight = txtMaxWeight.Text; objCourierRate.s_AppRate = txtRate.Text; objCourierRate.AppIsCOD = chkIsCOD.Checked; objCourierRate.Save(); objCourierRate = null; objCommon = null; return(true); } else { return(false); } }
public bool SaveSubscriber() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblSubscribe", tblSubscribe.ColumnNames.AppEmail, tblSubscribe.ColumnNames.AppSubscribeID, txtUserEmail.Text)) { DisplayInfoSubScribe.ShowMessage("Email address already exist", Enums.MessageType.Error); return(false); } objCommon = null; tblSubscribe objNewsLetterSubScriber = new tblSubscribe(); objNewsLetterSubScriber.AddNew(); objNewsLetterSubScriber.AppEmail = txtUserEmail.Text.Trim(); objNewsLetterSubScriber.AppIsActive = true; objNewsLetterSubScriber.AppCreatedDate = GetDateTime(); objNewsLetterSubScriber.Save(); SendMail(objNewsLetterSubScriber.s_AppSubscribeID); objNewsLetterSubScriber = null; return(true); }
private bool SaveData() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblColor", tblColor.ColumnNames.AppColorName, tblColor.ColumnNames.AppColorID, txtColorName.Text, hdnPKID.Value)) { DInfo.ShowMessage("Color Name alredy exits.", Enums.MessageType.Error); return(false); } objColor = new tblColor(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objColor.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objColor.AddNew(); objColor.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblColor", tblColor.ColumnNames.AppDisplayOrder); } // objColor.AppColorCode = txtColor.Text; string Time = Convert.ToString(DateTime.Now.Month) + Convert.ToString(DateTime.Now.Day) + Convert.ToString(DateTime.Now.Year) + Convert.ToString(DateTime.Now.Hour) + Convert.ToString(DateTime.Now.Minute) + Convert.ToString(DateTime.Now.Second); if (fileUploadColorImg.HasFile) { string strError = ""; string strPath = objCommon.FileUpload_Images(fileUploadColorImg.PostedFile, txtColorName.Text.Trim().Replace(" ", "_") + "_" + Time, "Uploads/ColorCode/", ref strError, 0, objColor.s_AppColorImage, false, 20, 20); if (strError == "") { objColor.s_AppColorImage = strPath; } else { DInfo.ShowMessage(strError, Enums.MessageType.Error); return(false); } } objColor.AppColorName = txtColorName.Text; objColor.AppIsActive = chkIsActive.Checked; if (chkIsDefault.Checked) { tblColor ObjTempcolor = new tblColor(); ObjTempcolor.SetDefaultColor(); ObjTempcolor = null; objColor.AppIsActive = true; objColor.AppIsDefault = true; } else { tblColor ObjTempcolor = new tblColor(); ObjTempcolor.LoadAll(); if (ObjTempcolor.RowCount <= 0) { objColor.AppIsActive = true; objColor.AppIsDefault = true; } else { objColor.AppIsDefault = false; } ObjTempcolor = null; } objColor.Save(); intPkId = objColor.AppColorID; objColor = null; objCommon = null; return(true); }
public bool SaveCustomer() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblCustomer", tblCustomer.ColumnNames.AppEmailID, tblCustomer.ColumnNames.AppCustomerID, txtEmail.Text, Session[appFunctions.Session.ClientUserID.ToString()].ToString())) { DInfo.ShowMessage("Email address already exist.", Enums.MessageType.Error); return(false); } tblCustomer objCustomer = new tblCustomer(); if (objCustomer.LoadByPrimaryKey(Convert.ToInt32(Session[appFunctions.Session.ClientUserID.ToString()].ToString()))) { objCustomer.AppFirstName = txtFirstName.Text.Trim(); objCustomer.AppLastName = txtLastName.Text.Trim(); objCustomer.AppEmailID = txtEmail.Text.Trim(); objCustomer.AppMobile = txtMobile.Text.Trim(); objCustomer.AppPhone = txtPhone.Text; //objCustomer.AppAddress = txtAddress.Text; //objCustomer.s_AppPincode = txtPincode.Text; if (RbtnMale.Checked) { objCustomer.AppGender = true; } else { objCustomer.AppGender = false; } if (FileUploadImg.HasFile) { string strError = ""; string Time = Convert.ToString(DateTime.Now.Month) + Convert.ToString(DateTime.Now.Day) + Convert.ToString(DateTime.Now.Year) + Convert.ToString(DateTime.Now.Hour) + Convert.ToString(DateTime.Now.Minute) + Convert.ToString(DateTime.Now.Second); string strPath = objCommon.FileUpload_Images(FileUploadImg.PostedFile, txtFirstName.Text.Trim().Replace(" ", "_") + "_" + txtLastName.Text.Trim().Replace(" ", "_") + "_" + Time, "Uploads/Customer/", ref strError, 0, objCustomer.s_AppImage, true); if (strError == "") { objCustomer.AppImage = strPath; } else { DInfo.ShowMessage(strError, Enums.MessageType.Error); return(false); } } //string strCountryId = ddlCountry.SelectedValue; //string strStateId = ddlState.SelectedValue; //string strCityID = ddlCity.SelectedValue; //if (ddlCountry.SelectedValue == "-1") //{ // tblCountry objCountry = new tblCountry(); // objCountry.Where.AppCountry.Value = txtcountry.Text; // objCountry.Query.Load(); // if (!(objCountry.RowCount > 0)) // { // objCountry.AddNew(); // objCountry.AppCountry = txtcountry.Text; // objCountry.Save(); // } // strCountryId = objCountry.s_AppCountryID; // objCountry = null; //} //if (ddlState.SelectedValue == "-1") //{ // tblState objState = new tblState(); // objState.Where.AppCountryID.Value = strCountryId; // objState.Where.AppState.Value = txtState.Text; // objState.Query.Load(); // if (!(objState.RowCount > 0)) // { // objState.AddNew(); // objState.AppState = txtState.Text; // objState.s_AppCountryID = strCountryId; // objState.Save(); // } // strStateId = objState.s_AppStateID; // objState = null; //} //if (ddlCity.SelectedValue == "-1") //{ // tblCity objCity = new tblCity(); // objCity.Where.AppStateID.Value = strStateId; // objCity.Where.AppCity.Value = txtCity.Text; // objCity.Query.Load(); // if (!(objCity.RowCount > 0)) // { // objCity.AddNew(); // objCity.AppCity = txtCity.Text; // objCity.s_AppStateID = strStateId; // objCity.Save(); // } // strCityID = objCity.s_AppCityID; // objCity = null; //} // objCustomer.s_AppCityId = strCityID; //objCustomer.s_AppStateId = strStateId; //objCustomer.s_AppCountryId = strCountryId; objCustomer.Save(); } objCustomer = null; objCommon = null; return(true); }