public bool SaveMenifest() { tblManifest objMenifest = new tblManifest(); string strError = ""; if (objMenifest.LoadByPrimaryKey(Convert.ToInt32(txtMenifestNo.Text))) { //if (objMenifest.s_AppUploadedManifest == "") //{ objClsCommon = new clsCommon(); 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(FileUploadMenifest.PostedFile, txtMenifestNo.Text.Trim().Replace(" ", "_") + "_" + Time, "Uploads/Menifest/", ref strError, 0, objMenifest.s_AppUploadedManifest, false, 0, 2000); if (strError == "") { objMenifest.AppUploadedManifest = strPath; } else { DInfo.ShowMessage(strError, Enums.MessageType.Error); return(false); } objMenifest.Save(); objClsCommon = null; //} //else { DInfo.ShowMessage("Menifest not exists.", Enums.MessageType.Error); } } else { DInfo.ShowMessage("Enter valid Menifest Number", Enums.MessageType.Error); } resetMenifestForm(); objMenifest = 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() { objClsCommon = new clsCommon(); objCustomer = new tblCustomer(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objCustomer.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objCustomer.AddNew(); } objCustomer.AppFirstName = txtFirstName.Text; objCustomer.AppLastName = txtLastName.Text; objCustomer.AppEmailID = txtEmail.Text; objEncrypt = new clsEncryption(); objCustomer.AppPassword = objEncrypt.Encrypt(txtPassword.Text, appFunctions.strKey); objEncrypt = null; objCustomer.AppMobile = txtMobile.Text; objCustomer.AppPhone = txtPhone.Text; if (RbtnMale.Checked) { objCustomer.AppGender = true; } else { objCustomer.AppGender = false; } objCustomer.AppIsVerified = chkIsVerified.Checked; 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 = objClsCommon.FileUpload_Images(FileUploadImg.PostedFile, txtFirstName.Text.Trim().Replace(" ", "_") + "_" + Time, "Uploads/Customer/", ref strError, 0, objCustomer.s_AppImage, false, 0, 2000); if (strError == "") { objCustomer.AppImage = strPath; } else { DInfo.ShowMessage(strError, Enums.MessageType.Error); return(false); } } objCustomer.AppIsActive = chkIsActive.Checked; objCustomer.AppIsNewsLetter = chkIsNewsLetter.Checked; objCustomer.Save(); iCustomerID = objCustomer.AppCustomerID; objCustomer = null; objClsCommon = null; return(true); }
protected void dgvGridView_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (!string.IsNullOrEmpty(e.CommandArgument.ToString())) { if (e.CommandName == "SaveFile") { GridViewRow gvRow = (GridViewRow)((Control)e.CommandSource).NamingContainer; Int32 rowind = gvRow.RowIndex; FileUpload FileImg = (FileUpload)gvRow.FindControl("fileUpload"); if (FileImg.HasFile) { tblManifest objMenifest = new tblManifest(); if (objMenifest.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()))) { if (objMenifest.s_AppUploadedManifest == "") { objCommon = 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 = objCommon.FileUpload_Images(FileImg.PostedFile, objMenifest.s_AppManifestID.Trim().Replace(" ", "_") + "_" + Time, "Uploads/Menifest/", ref strError, 0, objMenifest.s_AppUploadedManifest, false, 0, 2000); if (strError == "") { objMenifest.AppUploadedManifest = strPath; } else { DInfo.ShowMessage(strError, Enums.MessageType.Error); return; } objMenifest.Save(); objCommon = null; } else { DInfo.ShowMessage("Menifest not exists.", Enums.MessageType.Error); } } else { DInfo.ShowMessage("Enter valid Menifest Number.", Enums.MessageType.Error); } objMenifest = null; LoadDataGrid(true, false); } else { DInfo.ShowMessage("Select Manifest File.", Enums.MessageType.Error); } } } }
private bool SaveData() { if (FileUploadImg.HasFile) { objClsCommon = new clsCommon(); objBanner = new tblBanner(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objBanner.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objBanner.AddNew(); objBanner.AppDisplayOrder = objClsCommon.GetNextDisplayOrder("tblBanner", tblBanner.ColumnNames.AppDisplayOrder); } objBanner.AppTitle = txtBannerTitle.Text; objBanner.AppIsActive = chkIsActive.Checked; objBanner.AppUrl = txtappUrl.Text; objBanner.AppDescription = txtDescription.Text; 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 = objClsCommon.FileUpload_Images(FileUploadImg.PostedFile, txtBannerTitle.Text.Trim().Replace(" ", "_") + "_" + Time, "Uploads/Banner/", ref strError, 0, objBanner.s_AppImage, false, 600, 1600); if (strError == "") { objBanner.AppImage = strPath; } else { DInfo.ShowMessage(strError, Enums.MessageType.Error); return(false); } } objBanner.Save(); iBannerID = objBanner.AppBannerID; objBanner = null; objClsCommon = null; return(true); } else { DInfo.ShowMessage("Select Image First", Enums.MessageType.Error); return(false); } }
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); }
private bool SaveData() { objPageFormat = new tblPageFormat(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objPageFormat.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objPageFormat.AddNew(); objPageFormat.AppCreatedDate = System.DateTime.Now; objPageFormat.AppCreatedBy = Convert.ToInt32(Session[appFunctions.Session.UserID.ToString()]); } objPageFormat.AppPageFormatName = txtPageFormatName.Text; objPageFormat.AppPageName = txtPageName.Text; objPageFormat.AppDescription = txtDescription.Text; objPageFormat.AppIsActive = chkIsActive.Checked; 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, txtPageFormatName.Text.Trim().Replace(" ", "_") + "_" + Time, "Uploads/PageFormatImages/", ref strError, 0, objPageFormat.s_AppImage); if (strError == "") { objPageFormat.AppImage = strPath; } else { DInfo.ShowMessage(strError, Enums.MessageType.Error); return(false); } } objPageFormat.Save(); iPageFormateid = objPageFormat.AppPageFormatId; objPageFormat = null; objClsCommon = null; return(true); }
private bool SaveData() { objCommon = new clsCommon(); objExclusive = new tblExclusive(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objExclusive.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objExclusive.AddNew(); objExclusive.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblExclusive", tblExclusive.ColumnNames.AppDisplayOrder, tblExclusive.ColumnNames.AppCategoryID + "=" + ddlCategory.SelectedValue); } objExclusive.s_AppCategoryID = ddlCategory.SelectedValue; objExclusive.AppIsActive = chkIsActive.Checked; objExclusive.AppLink = txtLink.Text; objExclusive.AppTitle = txtTitle.Text; 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, ddlCategory.SelectedValue.ToString().Trim().Replace(" ", "_") + "_" + Time, "Uploads/Exclusive/", ref strError, 0, objExclusive.s_AppImage, false, 0, 400); if (strError == "") { objExclusive.AppImage = strPath; } else { DInfo.ShowMessage(strError, Enums.MessageType.Error); return(false); } } objExclusive.Save(); iExclusiveID = objExclusive.AppExclusiveID; objExclusive = null; objCommon = null; return(true); }
private bool SaveData() { objTab = new tblTab(); if (!string.IsNullOrEmpty(hdnPKID.Value)) { objTab.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objTab.AddNew(); objTab.AppCreatedDate = System.DateTime.Now; objTab.AppCreatedBy = (int)Session[appFunctions.Session.UserID.ToString()]; } objTab.AppTabName = txtTabName.Text; if (objTab.s_AppParentID != ddlParent.SelectedValue.ToString()) { objTab.AppDisplayOrder = objClsCommon.GetNextDisplayOrder("tblTab", tblTab.ColumnNames.AppDisplayOrder, " appParentID = " + ddlParent.SelectedValue); } objTab.AppParentID = Convert.ToInt32(ddlParent.SelectedValue); if (!string.IsNullOrEmpty(txtWebPageName.Text) & txtWebPageName.Text != "#") { tblTab objTemp = new tblTab(); objTemp.Where.AppWebPageName.Value = txtWebPageName.Text; objTemp.Query.AddResultColumn(tblTab.ColumnNames.AppTabID); objTemp.Query.Load(); if (objTemp.RowCount > 0) { if (objTemp.AppTabID != Convert.ToInt32(hdnPKID.Value)) { DInfo.ShowMessage("The Specified Web Page is already allocated to another tab", Enums.MessageType.Error); } } objTab.AppWebPageName = txtWebPageName.Text; } else { objTab.AppWebPageName = "#"; } objTab.AppIsActive = ChkIsActive.Checked; objTab.AppIsAdd = chkIsAdd.Checked; objTab.AppIsEdit = chkIsEdit.Checked; objTab.AppIsDelete = chkIsDelete.Checked; if (chkHasAddOption.Checked == true) { objTab.AppAddPage = txtAddPage.Text; } else { objTab.AppAddPage = ""; } if (chkIsShowOnDashboard.Checked == true) { objTab.AppIsShowOnDashboard = true; if ((FileUploadIcon.HasFile)) { //string fileName = System.IO.Path.GetFileNameWithoutExtension(FileUploadIcon.FileName).ToString(); //string extension = System.IO.Path.GetExtension(FileUploadIcon.FileName).ToString(); //FileUploadIcon.SaveAs(Server.MapPath(strImagePath) + fileName + fileAppend + extension); //try //{ // System.IO.File.Delete(Server.MapPath(".") + Server.MapPath(strImagePath) + objTab.AppIconPath); //} //catch (Exception ex) //{ //} //objTab.AppIconPath = fileName + fileAppend + extension; 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(FileUploadIcon.PostedFile, txtTabName.Text.Trim().Replace(" ", "_") + "_" + Time, "Uploads/TabImages/", ref strError, 0, objTab.AppIconPath); if (strError == "") { objTab.AppIconPath = strPath; } else { DInfo.ShowMessage(strError, Enums.MessageType.Error); return(false); } } } else { objTab.AppIsShowOnDashboard = false; objTab.AppIconPath = ""; } ////If IsMenu Is True if (chkIsMenu.Checked == true) { ////Make All Others IsMenu To False tblTab objTemp = new tblTab(); objTemp.updateIsMenu(); objTab.AppIsMenu = true; } else { objTab.AppIsMenu = false; } objTab.Save(); objTab = 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); }