예제 #1
0
    protected void btnSave_Click(object sender, EventArgs e) //button Save
    {
        lblMsg.Text = lblMsg.CssClass = "";

        if (!CommonCls.CheckGUIDIsValid())
        {
            return;
        }

        objSundriModel             = new SundriesModel();
        objSundriModel.Ind         = 3;
        objSundriModel.OrgID       = GlobalSession.OrgID;
        objSundriModel.TblSundries = CreateAccountHeadData();

        string    uri        = string.Format("Sundri/SaveChkAllocated");
        DataTable dtSaveItem = CommonCls.ApiPostDataTable(uri, objSundriModel);

        if (dtSaveItem.Rows.Count > 0)
        {
            ShowMessage("Data Save Successfully!", true);
        }
        else
        {
            ShowMessage("Data Not Save Successfully!", false);
        }
    }
예제 #2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            lblMsg.Text = lblMsg.CssClass = "";

            if (!CommonCls.CheckGUIDIsValid())
            {
                return;
            }

            if (ddlFillVoucher.SelectedValue == "0")
            {
                ddlFillVoucher.Focus();
                ShowMessage("Select Voucher Type..!", false);
                return;
            }
            if (string.IsNullOrEmpty(txtSnarration.Text.Trim()))
            {
                txtSnarration.Focus();
                ShowMessage("Enter Narration..!", false);
                return;
            }
            objNarrMastermodel = new NarrationMasterModel()
            {
                Ind   = 2,
                OrgID = GlobalSession.OrgID,
                BrID  = GlobalSession.BrID,
                YrCD  = GlobalSession.YrCD,
                User  = GlobalSession.UserID,
                IP    = GlobalSession.IP,
            };

            objNarrMastermodel.DocTypeID = Convert.ToInt32(ddlFillVoucher.SelectedItem.Value);

            objNarrMastermodel.NarrDesc = txtSnarration.Text;
            string    uri = string.Format("NarrationMaster/SaveProcess");
            DataTable WarehouSaveProcess = CommonCls.ApiPostDataTable(uri, objNarrMastermodel);
            if (WarehouSaveProcess.Rows.Count > 0)
            {
                ShowMessage("Data Is SucessFully Saved..!", true);
            }
            else
            {
                ShowMessage("Data Is Not Saved SucessFully..!", false);
            }
            FillGrid();
            clear();
        }
        catch (Exception ex)
        {
            // ShowMessage(ex.Message, false);
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (!CommonCls.CheckGUIDIsValid())
            {
                return;
            }

            objplOpenStock = new ItemOpenningStockModel();

            if (CommonCls.ConvertIntZero(ddlItemName.SelectedValue) == 0)
            {
                ddlItemName.Focus();
                ShowMessage("Fill Item Detail..", false);
                return;
            }
            if (gridOpenStock.Rows.Count > 0)
            {
                objplOpenStock.Ind    = 31;
                objplOpenStock.OrgID  = GlobalSession.OrgID;
                objplOpenStock.YrCD   = GlobalSession.YrCD;
                objplOpenStock.User   = GlobalSession.UserID;
                objplOpenStock.IP     = GlobalSession.IP;
                objplOpenStock.ItemID = Convert.ToInt32(ddlItemName.SelectedValue);

                objplOpenStock.DtItem = VsDtOpenStock;

                if (objplOpenStock.DtItem.Columns.Contains("ItemID"))
                {
                    objplOpenStock.DtItem.Columns.Remove("ItemID");
                }
                //if (objplOpenStock.DtItem.Columns.Contains("WareHouseName"))
                //{
                //    objplOpenStock.DtItem.Columns.Remove("WareHouseName");
                //}
                if (objplOpenStock.DtItem.Columns.Contains("Address"))
                {
                    objplOpenStock.DtItem.Columns.Remove("Address");
                }


                string    uri = string.Format("ItemOpenStock/SaveStockEntry");
                DataTable dtSaveopenStockEntry = CommonCls.ApiPostDataTable(uri, objplOpenStock);
                if (dtSaveopenStockEntry.Rows.Count > 0)
                {
                    ShowMessage("Data Is SucessFully Saved..", true);
                    ClearAfterSaved();
                    VsDtOpenStock = null;
                    // fillGrid();
                }
                else
                {
                    ShowMessage("Data Is Not Saved..", false);
                }
            }
            else
            {
                ShowMessage("Fill All Item Detail..", false);
            }
            fillGrid();
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
예제 #4
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (!CommonCls.CheckGUIDIsValid())
            {
                return;
            }


            bool IsValid = ValidationBtnSave();
            if (!IsValid)
            {
                return;
            }

            objItemMaster                  = new ItemMasterModel();
            objItemMaster.Ind              = 3;
            objItemMaster.OrgID            = GlobalSession.OrgID;
            objItemMaster.YrCD             = GlobalSession.YrCD;
            objItemMaster.ItemMainID       = Convert.ToInt32(hfMainGrCode.Value);
            objItemMaster.ItemSubID        = Convert.ToInt32(hfSubGrCode.Value);
            objItemMaster.ItemMinorID      = Convert.ToInt32(ddlMinorGroup.SelectedValue);
            objItemMaster.ItemGroupID      = Convert.ToInt32(hfItemGroupID.Value);
            objItemMaster.ItemName         = txtItemName.Text;
            objItemMaster.ItemShortName    = txtShortName.Text;
            objItemMaster.ItemUnitID       = Convert.ToInt32(ddlItemUnit.SelectedValue);
            objItemMaster.GoodServiceInd   = Convert.ToInt32(ddlItemType.SelectedValue);
            objItemMaster.ItemSellingRate  = CommonCls.ConvertDecimalZero(txtSellingRate.Text);
            objItemMaster.ItemDesc         = txtItemDescription.Text == null ? "" : txtItemDescription.Text;
            objItemMaster.HSNSACCode       = txtHSNSACCode.Text; //ddlHSNSACCode.SelectedValue;
            objItemMaster.ItemCode         = Convert.ToInt64(hfMainGrCode.Value + hfSubGrCode.Value + ddlMinorGroup.SelectedValue);
            objItemMaster.User             = GlobalSession.UserID;
            objItemMaster.IP               = GlobalSession.IP;
            objItemMaster.DtItemOpening    = (DataTable)ViewState["dtItemOSE"];
            objItemMaster.ItemMinorUnitID  = CommonCls.ConvertIntZero(ddlMinorUnit.SelectedValue);
            objItemMaster.ItemMinorUnitQyt = CommonCls.ConvertDecimalZero(txtMinorUnitQty.Text);
            objItemMaster.TaxRate          = CommonCls.ConvertDecimalZero(ddlTaxrate.SelectedValue) < CommonCls.ConvertDecimalZero("0.05") ? 0 : CommonCls.ConvertDecimalZero(ddlTaxrate.SelectedValue);
            objItemMaster.TaxRateDesc      = ddlTaxrate.SelectedItem.Text;
            objItemMaster.StockMaintainInd = 0;


            if (objItemMaster.DtItemOpening != null)
            {
                if (objItemMaster.DtItemOpening.Columns.Contains("ItemID"))
                {
                    objItemMaster.DtItemOpening.Columns.Remove("ItemID");
                }
                if (objItemMaster.DtItemOpening.Columns.Contains("WareHouseName"))
                {
                    objItemMaster.DtItemOpening.Columns.Remove("WareHouseName");
                }
                //if (objItemMaster.DtItemOpening.Columns.Contains("Warehouse"))
                //{
                //    objItemMaster.DtItemOpening.Columns.Remove("Warehouse");
                //}
            }
            else
            {
                objItemMaster.DtItemOpening = DtItemOSESchema();
                DataRow drItemOpening = objItemMaster.DtItemOpening.NewRow();

                if (objItemMaster.DtItemOpening.Columns.Contains("ItemID"))
                {
                    objItemMaster.DtItemOpening.Columns.Remove("ItemID");
                }
                if (objItemMaster.DtItemOpening.Columns.Contains("WareHouseName"))
                {
                    objItemMaster.DtItemOpening.Columns.Remove("WareHouseName");
                }

                drItemOpening["OpeningUnit"]      = "";
                drItemOpening["OpeningMinorUnit"] = "";
                drItemOpening["OpeningMinorQty"]  = "";

                drItemOpening["OrgId"]       = 0;
                drItemOpening["WarehouseId"] = 0;
                drItemOpening["OpeningQty"]  = 0;
                drItemOpening["OpRate"]      = 0;
                drItemOpening["OpDate"]      = "";
                objItemMaster.DtItemOpening.Rows.Add(drItemOpening);
                //objItemMaster.DtItemOpening.Columns.Remove("Warehouse");
            }

            string    uri    = string.Format("ItemMaster/SaveItem");
            DataTable dtSave = CommonCls.ApiPostDataTable(uri, objItemMaster);
            if (dtSave.Rows.Count > 0)
            {
                if (dtSave.Rows[0]["Column1"].ToString() == "1")
                {
                    ClearAll();
                    ShowMessage("Item Save successfully.", true);
                    ddlMinorGroup.Focus();
                }
                else if (dtSave.Rows[0]["Column1"].ToString() == "2")
                {
                    ShowMessage("Item Already Added.", false);
                    txtItemName.Focus();
                }
                else if (dtSave.Rows[0]["Column1"].ToString() == "3")
                {
                    ShowMessage("Invalid HSN / SAC Code.", false);
                    txtHSNSACCode.Focus();
                }
            }
            else
            {
                ShowMessage("Record Not Save Please Try Again.", false);
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
예제 #5
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (!CommonCls.CheckGUIDIsValid())
            {
                return;
            }

            if (ddlGroupType.SelectedValue == "0")
            {
                ddlGroupType.Focus();
                lblMsg.Text = "Select Group Type..!";
                return;
            }
            if (ddlGroupType.SelectedValue == "2")
            {
                if (ddlMainGroup.SelectedValue == "0")
                {
                    ddlMainGroup.Focus();
                    lblMsg.Text = "Select  Main Group!";
                    return;
                }
            }
            else if (ddlGroupType.SelectedValue == "3")
            {
                if (ddlMainGroup.SelectedValue == "0")
                {
                    ddlMainGroup.Focus();
                    lblMsg.Text = "Select  Main Group!";
                    return;
                }
                if (ddlSubGroup.SelectedValue == "0")
                {
                    lblMsg.Text = "Select  Sub Group!";
                    return;
                }
            }
            if (string.IsNullOrEmpty(txtName.Text.Trim()))
            {
                txtName.Focus();
                lblMsg.Text = "Enter Group Name..! ";
                return;
            }
            objplgroupType       = new GroupTypeMasterModel();
            objplgroupType.Ind   = 1;
            objplgroupType.OrgID = GlobalSession.OrgID;
            objplgroupType.User  = GlobalSession.UserID;
            objplgroupType.IP    = GlobalSession.IP;

            objplgroupType.GrType = Convert.ToInt32(ddlGroupType.SelectedItem.Value);
            if (ddlGroupType.SelectedValue == "1")
            {
                objplgroupType.ParentID = 0;
            }
            else if (ddlGroupType.SelectedValue == "2")
            {
                objplgroupType.ParentID = Convert.ToInt32(ddlMainGroup.SelectedValue);
            }
            else if (ddlGroupType.SelectedValue == "3")
            {
                objplgroupType.ParentID = Convert.ToInt32(ddlSubGroup.SelectedValue);
            }

            //objplgroupType.ParentID = string.IsNullOrEmpty(ddlMainGroup.SelectedValue) ? 0 : ddlSubGroup.SelectedValue;
            //objplgroupType.ParentID = Convert.ToInt32(ddlMainGroup.SelectedValue == null ? "0" : ddlMainGroup.SelectedValue == null ? "0" : ddlSubGroup.SelectedValue);

            objplgroupType.GrDesc = txtName.Text;
            string    uri = string.Format("GroupTypeMaster/SaveGroupItem");
            DataTable GroupMasterSaveProcess = CommonCls.ApiPostDataTable(uri, objplgroupType);
            if (GroupMasterSaveProcess.Rows.Count > 0)
            {
                if (GroupMasterSaveProcess.Rows[0]["RecordID"].ToString() == "1")
                {
                    lblMsg.Text = "Data Is SucessFully Saved..!";
                }
                else if (GroupMasterSaveProcess.Rows[0]["RecordID"].ToString() == "2")
                {
                    lblMsg.Text = "Data Already Added.";
                }
            }
            else
            {
                lblMsg.Text = "Data Is Not Saved..!";
            }
            clear();
        }
        catch (Exception ex)
        {
        }
    }