Пример #1
0
    public string GetColorId(string strColorName)
    {
        string   StrColor = "";
        tblColor objColor = new tblColor();

        objColor.Where.AppColorName.Value = strColorName;
        objColor.Query.Load();
        if (objColor.RowCount <= 0)
        {
            objColor.AddNew();
            objColor.s_AppColorName = strColorName;
            objColor.AppColorCode   = "#FFF";
            objColor.AppIsActive    = true;
            objColor.AppIsDefault   = false;
            objCommon = new clsCommon();
            objColor.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblColor", tblColor.ColumnNames.AppDisplayOrder);
            objCommon = null;
            objColor.Save();
        }

        StrColor = objColor.s_AppColorID;
        objColor = null;

        return(StrColor);
    }
    protected void dgvProduct_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
        {
            objCommon     = new clsCommon();
            hdnPKID.Value = e.CommandArgument.ToString();
            if (e.CommandName == "Save")
            {
                objCommon          = new clsCommon();
                objFeaturedProduct = new tblFeaturedProduct();

                objFeaturedProduct.AddNew();
                objFeaturedProduct.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblFeaturedProduct", tblFeaturedProduct.ColumnNames.AppDisplayOrder);

                objFeaturedProduct.s_AppProductID = e.CommandArgument.ToString();
                objFeaturedProduct.AppIsActive    = true;

                objFeaturedProduct.Save();

                objFeaturedProduct = null;
                objCommon          = null;
                LoadProduc1(true, false);

                LoadDataGrid(true, false);
            }
        }
    }
Пример #3
0
 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("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);
    }
Пример #6
0
    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);
    }
Пример #7
0
    private bool SaveSubCategoryData()
    {
        if (hdnPKID.Value != "")
        {
            objCommon = new clsCommon();

            objPropertySubCategory = new tblPropertySubCategory();


            objPropertySubCategory.AddNew();
            objPropertySubCategory.s_AppCreatedBy = Session[appFunctions.Session.UserID.ToString()].ToString();

            objPropertySubCategory.AppCreatedDate  = DateTime.Now;
            objPropertySubCategory.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblPropertySubCategory", tblPropertySubCategory.ColumnNames.AppDisplayOrder, tblPropertySubCategory.ColumnNames.AppPropertyID + "=" + hdnPKID.Value);

            objPropertySubCategory.s_AppPropertyID = hdnPKID.Value;

            objPropertySubCategory.Save();
            objPropertySubCategory = null;
            objCommon = null;
            return(true);
        }
        else
        {
            return(false);
        }
    }
 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);
 }
Пример #10
0
    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);
        }
    }
 protected void dgvUnSelectedSize_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
     {
         if (e.CommandName == "IsAdd")
         {
             objCommon          = new clsCommon();
             objSizeSubCategory = new tblSizeSubCategory();
             objSizeSubCategory.AddNew();
             objSizeSubCategory.s_AppDisplayOrder  = objCommon.GetNextDisplayOrder("tblSizeSubCategory", tblSizeSubCategory.ColumnNames.AppDisplayOrder, tblSizeSubCategory.ColumnNames.AppSubCategoryID + "=" + hdnPKID.Value).ToString();
             objSizeSubCategory.s_AppSizeID        = e.CommandArgument.ToString();
             objSizeSubCategory.s_AppSubCategoryID = hdnPKID.Value;
             objSizeSubCategory.Save();
             objSizeSubCategory = null;
             loadUnselectedSizeGrid();
             LoadSubCategoryData(false, false);
             objCommon = null;
         }
     }
 }
Пример #12
0
    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);
    }
Пример #13
0
    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);
    }
Пример #14
0
    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);
        }
    }
Пример #15
0
    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);
    }
Пример #16
0
    private bool SaveData()
    {
        objMenuItem = new tblMenuItem();
        objCommon   = new clsCommon();

        if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "")
        {
            objMenuItem.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value));
        }
        else
        {
            objMenuItem.AddNew();
            objMenuItem.AppCreatedDate = System.DateTime.Now;
            objMenuItem.AppCreatedBy   = Convert.ToInt32(Session[appFunctions.Session.UserID.ToString()]);
        }
        if (chkCreatePage.Checked)
        {
            string strPageAlias = "";
            int    intPageID    = 0;
            objPage = new tblPage();
            if (rdbEditExisting.Checked)
            {
                objPage.LoadByPrimaryKey(Convert.ToInt32(hdnPageId.Value));
                strPageAlias = txtNewPageAlias.Text;
                intPageID    = Convert.ToInt32(hdnPageId.Value);
            }
            else if (rdbUseExistingPage.Checked && txtMenuPageAlias.Text != "")
            {
                objPage.LoadByPrimaryKey(Convert.ToInt32(ddlPages.SelectedValue));
                strPageAlias = txtMenuPageAlias.Text;
                intPageID    = Convert.ToInt32(ddlPages.SelectedValue);
            }
            else if (rdbUseExistingPage.Checked && txtMenuPageAlias.Text == "")
            {
                objMenuItem.s_AppPageId = ddlPages.SelectedValue;
                goto saveMenuItem;
            }
            else if (rdbCreateNewPage.Checked)
            {
                objPage.AddNew();
                objPage.s_AppCreatedBy = Session[appFunctions.Session.UserID.ToString()].ToString();
                strPageAlias           = txtNewPageAlias.Text;
                objPage.AppCreatedDate = DateTime.Now;
            }
            ;

            if (rdbCreateNewPage.Checked || rdbEditExisting.Checked)
            {
                if (checkPage(txtPageName.Text, false, intPageID) != true)
                {
                    DInfo.ShowMessage("The Page name already exists!!", Enums.MessageType.Error);
                    return(false);
                }
            }
            if (checkPage(strPageAlias, true, intPageID) != true)
            {
                DInfo.ShowMessage("The Page alias already exists!!", Enums.MessageType.Error);
                return(false);
            }
            if (rdbCreateNewPage.Checked || rdbEditExisting.Checked)
            {
                if (chkIsDefault.Checked)
                {
                    tblPage objPageTemp = new tblPage();
                    objPageTemp.ResetDefaultPage();
                    objPageTemp          = null;
                    objPage.AppIsDefault = chkIsDefault.Checked;
                }
                else
                {
                    objPage.AppIsDefault = false;
                }
                objPage.AppIsLink = chkIsLink.Checked;
                if (chkIsLink.Checked)
                {
                    objPage.AppLinkURL        = txtLinkURL.Text;
                    objPage.AppIsOpenInNewTab = chkIsOpenInNewTab.Checked;

                    objPage.AppPageFormatId = 0;
                }
                else
                {
                    objPage.s_AppPageFormatId = ddlPageFormats.SelectedValue;

                    objPage.AppLinkURL        = "";
                    objPage.AppIsOpenInNewTab = false;
                }
                objPage.AppPageContent         = txtDescription.Text;
                objPage.AppPageHeading         = txtPageHeader.Text;
                objPage.AppPageName            = txtPageName.Text;
                objPage.AppPageTitle           = txtPageTitle.Text;
                objPage.AppSEODescription      = txtSEODescription.Text;
                objPage.AppSEOWord             = txtSEOWord.Text;
                objPage.s_AppDynamicParameters = CkEditorDynParameters.Text;
            }
            strPageAlias = strPageAlias.Replace(" ", "-");
            if (chkIsStatic.Checked)
            {
                objPage.AppAlias = strPageAlias;
            }
            else
            {
                objPage.AppAlias = strPageAlias + "/{*name}";
            }
            objPage.Save();
            objMenuItem.AppPageId = objPage.AppPageId;
        }
        else
        {
            objMenuItem.AppPageId = 0;
        }

saveMenuItem:
        if (ChkIsActive.Checked)
        {
            objMenuItem.AppIsActive = true;
        }
        else
        {
            objMenuItem.AppIsActive = false;
        }
        objMenuItem.s_AppMenuItemTypeID = ddlMenuItemType.SelectedValue;
        objMenuItem.s_AppMenuItem       = txtMenuItemName.Text;
        objMenuItem.s_AppParentId       = ddlParent.SelectedValue;
        objMenuItem.s_AppMenuTypeId     = ddlMenuType.SelectedValue;
        if (hdnPKID.Value == "")
        {
            objMenuItem.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblMenuItem", tblMenuItem.ColumnNames.AppDisplayOrder, "appMenuTypeId = " + objMenuItem.AppMenuTypeId.ToString() + " and appParentID = " + objMenuItem.AppParentId.ToString());
        }
        objMenuItem.Save();
        iMenuItemid = objMenuItem.AppMenuItemId;
        objMenuItem = null;
        objCommon   = null;
        return(true);
    }
Пример #17
0
    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);
    }
Пример #18
0
    public Boolean SaveLeadData()
    {
        DataTable objDataTable = new DataTable();

        if (Session[appFunctions.Session.LeadDataTable.ToString()] != null)
        {
            objDataTable = (DataTable)Session[appFunctions.Session.LeadDataTable.ToString()];
        }
        if (objDataTable.Rows.Count <= 0)
        {
            DInfo.ShowMessage("Some Error Occure Try again!.", Enums.MessageType.Error);
            return(false);
        }


        objCommon = new clsCommon();
        foreach (DataRow row in objDataTable.Rows)
        {
            tblProduct objProduct = new tblProduct();
            objProduct.Where.AppProductName.Value = row[Enums.Enums_ProductHeader.Product_Name.ToString().Replace("_", " ").Trim().ToLower()].ToString();
            objProduct.Query.Load();
            if (objProduct.RowCount <= 0)
            {
                objProduct.AddNew();
            }
            objProduct.s_AppProductName = row[Enums.Enums_ProductHeader.Product_Name.ToString().Replace("_", " ").Trim().ToLower()].ToString();
            objProduct.s_AppProductCode = row[Enums.Enums_ProductHeader.Product_Code.ToString().Replace("_", " ").Trim().ToLower()].ToString();
            objProduct.s_AppDescription = row[Enums.Enums_ProductHeader.Description.ToString().Replace("_", " ").Trim().ToLower()].ToString();
            //objProduct.s_AppProductTag = row[Enums.Enums_ProductHeader.Description.ToString().Replace("_", " ").Trim().ToLower()].ToString();
            objProduct.s_AppMetaKeyWord     = row[Enums.Enums_ProductHeader.Meta_KeyWord.ToString().Replace("_", " ").Trim().ToLower()].ToString();
            objProduct.s_AppMetaDescription = row[Enums.Enums_ProductHeader.Meta_Description.ToString().Replace("_", " ").Trim().ToLower()].ToString();
            objProduct.AppIsFeatured        = false;
            objProduct.AppIsNewArrival      = false;
            objProduct.AppIsBestSeller      = false;
            objProduct.AppIsColor           = true;
            objProduct.AppIsSize            = true;
            objProduct.Save();

            //Color Add or Modify

            string          strColorId      = GetColorId(row[Enums.Enums_ProductHeader.Color_Name.ToString().Replace("_", " ").Trim().ToLower()].ToString());
            tblProductColor objProductColor = new tblProductColor();
            objProductColor.Where.AppProductID.Value = objProduct.s_AppProductID;
            objProductColor.Where.AppColorID.Value   = strColorId;
            objProductColor.Query.Load();
            if (objProductColor.RowCount <= 0)
            {
                objProductColor.AddNew();
                objProductColor.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblProductColor", tblProductColor.ColumnNames.AppDisplayOrder, tblProductColor.ColumnNames.AppProductID + "=" + objProduct.s_AppProductID);
            }
            objProductColor.s_AppColorID   = strColorId;
            objProductColor.s_AppProductID = objProduct.s_AppProductID;


            if (objProductColor.AppDisplayOrder == 1)
            {
                objProductColor.AppIsDefault = true;
            }
            else
            {
                objProductColor.AppIsDefault = false;
            }
            objProductColor.AppIsActive = true;

            objProductColor.Save();


            //Size Add or Modify
            string strSizeId = GetSizeId(row[Enums.Enums_ProductHeader.Size.ToString().Replace("_", " ").Trim().ToLower()].ToString());

            tblProductDetail objProductDetail = new tblProductDetail();
            objProductDetail.Where.AppProductColorID.Value = objProductColor.s_AppProductColorID;
            objProductDetail.Where.AppSizeID.Value         = strSizeId;
            objProductDetail.Query.Load();
            if (objProductDetail.RowCount <= 0)
            {
                objProductDetail.AddNew();
            }
            objProductDetail.s_AppProductColorID = objProductColor.s_AppProductColorID;
            //objProductDetail.s_AppSellerPrice = row[Enums.Enums_ProductHeader.Seller_Price.ToString().Replace("_", " ").Trim().ToLower()].ToString();
            objProductDetail.s_AppMRP      = row[Enums.Enums_ProductHeader.MRP.ToString().Replace("_", " ").Trim().ToLower()].ToString();
            objProductDetail.s_AppPrice    = row[Enums.Enums_ProductHeader.Price.ToString().Replace("_", " ").Trim().ToLower()].ToString();
            objProductDetail.s_AppQuantity = row[Enums.Enums_ProductHeader.Quantity.ToString().Replace("_", " ").Trim().ToLower()].ToString();
            objProductDetail.AppSKUNo      = row[Enums.Enums_ProductHeader.SKU_No.ToString().Replace("_", " ").Trim().ToLower()].ToString();
            objProductDetail.s_AppSizeID   = strSizeId;
            objProductDetail.AppIsDefault  = false;
            tblProductDetail objTempmg = new tblProductDetail();
            objTempmg.Where.AppProductColorID.Value = strSizeId;
            objTempmg.Query.Load();
            if (objTempmg.RowCount <= 0)
            {
                objProductDetail.AppIsDefault = true;
            }
            objTempmg = null;

            objProductDetail.Save();

            objProductDetail = null;


            string StrFolder  = "Uploads/Product/" + objProduct.s_AppProductID + "/";
            string strImgName = objProduct.s_AppProductName.Trim().Replace(" ", "_") + "_" + row[Enums.Enums_ProductHeader.Color_Name.ToString().Replace("_", " ").Trim().ToLower()].ToString().Replace(" ", "_");

            if (!(System.IO.Directory.Exists(Server.MapPath("~/admin/" + StrFolder))))
            {
                System.IO.Directory.CreateDirectory(Server.MapPath("~/admin/" + StrFolder));
            }
            for (int i = 1; i <= 4; i++)
            {
                string ImgPath = row[Enums.Enums_ProductHeader.Image.ToString().Replace("_", " ").Trim().ToLower() + " " + i.ToString()].ToString();

                try
                {
                    System.Drawing.Bitmap upBmp = (System.Drawing.Bitmap)System.Drawing.Image.FromFile(ImgPath);

                    if (row[Enums.Enums_ProductHeader.Image.ToString().Replace("_", " ").Trim().ToLower() + " " + i.ToString()].ToString() != "")
                    {
                        tblProductImage objProductImg = new tblProductImage();
                        objProductImg.AddNew();
                        objProductImg.s_AppProductColorID = objProductColor.s_AppProductColorID;
                        objProductImg.AppDisplayOrder     = objCommon.GetNextDisplayOrder("tblProductImage", tblProductImage.ColumnNames.AppDisplayOrder, tblProductImage.ColumnNames.AppProductColorID + "=" + objProductColor.s_AppProductColorID);
                        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) + Convert.ToString(DateTime.Now.Millisecond);
                        string strPath  = objCommon.ResizeDirectImagesFile(ImgPath, strImgName + "_" + Time + "_Thumb", 0, ref strError, StrFolder, 0, 91);
                        if (strError == "")
                        {
                            objProductImg.s_AppThumbImage = strPath;
                        }
                        strError = "";
                        strPath  = objCommon.ResizeDirectImagesFile(ImgPath, strImgName + "_" + Time + "_Normal", 0, ref strError, StrFolder, 0, 300);
                        if (strError == "")
                        {
                            objProductImg.s_AppNormalImage = strPath;
                        }
                        strError = "";
                        strPath  = objCommon.ResizeDirectImagesFile(ImgPath, strImgName + "_" + Time + "_Large", 0, ref strError, StrFolder, 0, 900);
                        if (strError == "")
                        {
                            objProductImg.s_AppLargeImage = strPath;
                        }
                        strError = "";
                        strPath  = objCommon.ResizeDirectImagesFile(ImgPath, strImgName + "_" + Time + "_Small", 0, ref strError, StrFolder, 0, 210);
                        if (strError == "")
                        {
                            objProductImg.s_AppSmallImage = strPath;
                        }
                        objProductImg.AppIsActive  = true;
                        objProductImg.AppIsDefault = false;

                        if (objProductImg.AppDisplayOrder == 1)
                        {
                            objProductImg.AppIsActive  = true;
                            objProductImg.AppIsDefault = true;
                        }
                        objProductImg.Save();
                        objProductImg = null;
                    }
                }
                catch (Exception ex)
                {
                }
            }
            objProductColor = null;

            objProduct = null;
            //objlead.s_appcampaignid = row["appcampaignid"].tostring();
        }
        objCommon    = null;
        objDataTable = null;
        return(true);
    }