Example #1
0
 //Bind records of selected cost center mapped with product division to edit it
 private void BindSelected(int intCostCenterId)
 {
     try
     {
         lblMessage.Text = "";
         objCostCenter.BindACostCenterId(intCostCenterId, "SELECTING_PARTICULAR_COST_CENTER");
         txtCostCenterCode.Text = objCostCenter.CostCenterCode;
         txtCostCenterDesc.Text = objCostCenter.CostCenterDesc;
         txtBACode.Text         = objCostCenter.BACode;
         if (objCostCenter.Active_Flag == 1)
         {
             rdoStatus.ClearSelection();
             rdoStatus.Items[0].Selected = true;
         }
         else
         {
             rdoStatus.ClearSelection();
             rdoStatus.Items[1].Selected = true;
         }
         ddlDivision.SelectedIndex = ddlDivision.Items.IndexOf(ddlDivision.Items.FindByValue(objCostCenter.DivisionID.ToString()));
     }
     catch (Exception ex)
     {
         lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
         //Writing Error message to File using CommonClass WriteErrorErrFile method taking arguments as URL of page
         // trace, error message
         SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
     }
 }
Example #2
0
 protected void imgBtnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         //Assigning values to properties
         objIncoTerms.Inco_Terms_Id   = 0;
         objIncoTerms.Inco_Terms_Code = txtCode.Text.Trim();
         objIncoTerms.Inco_Terms_Desc = txtDescription.Text.Trim();
         objIncoTerms.ActiveFlag      = rdoStatus.SelectedValue.ToString();
         string strMsg = objIncoTerms.SaveData("INSERT_INCO_TERMS");
         if (objIncoTerms.ReturnValue == -1)
         {
             lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
         }
         else
         {
             if (strMsg == "Exists")
             {
                 lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DulplicateRecord, SIMSenuMessageType.UserMessage, false, "");
             }
             else
             {
                 lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.AddRecord, SIMSenuMessageType.UserMessage, false, "");
             }
         }
     }
     catch (Exception ex)
     {
         //Writing Error message to File using SIMSCommonClass WriteErrorErrFile method taking arguments as URL of page
         // trace, error message
         SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
     }
     objCommonClass.BindDataGrid(gvComm, "uspIncoTerms", true, sqlParamSrh, lblRowCount);
     ClearControls();
 }
    protected void imgBtnApprove_Click(object sender, EventArgs e)
    {
        Label  lbldocno;
        String strSuc = "";

        foreach (GridViewRow gr in GvDetails.Rows)
        {
            if (gr.RowType == DataControlRowType.DataRow)
            {
                if ((gr.FindControl("chkChild") as CheckBox).Checked)
                {
                    lbldocno = gr.FindControl("lbldocno") as Label;
                    objASCSparePurchaseOutside.AutoGeneratedNumber = lbldocno.Text;
                    objASCSparePurchaseOutside.UserName            = Membership.GetUser().UserName.ToString();
                    objASCSparePurchaseOutside.IsApproved          = true;
                    strSuc = objASCSparePurchaseOutside.ApprovalBillsMain();
                }
            }
        }



        if (objASCSparePurchaseOutside.ReturnValue == -1)
        {
            lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
        }
        else
        {
            lblMessage.Text = "Bill(s) Approved Sucessfully.";
            objASCSparePurchaseOutside.RegionSno           = "0";
            objASCSparePurchaseOutside.BranchSno           = "0";
            objASCSparePurchaseOutside.AutoGeneratedNumber = "";
            objASCSparePurchaseOutside.GetBillsForApprovalMain(GvDetails);
        }
    }
    protected void imgBtnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            objTaxFormMaster.TaxForm_Code = txtTaxFormCode.Text.Trim();
            objTaxFormMaster.TaxForm_Desc = txtTaxFormDesc.Text.Trim();
            objTaxFormMaster.EmpCode      = Membership.GetUser().UserName.ToString();
            objTaxFormMaster.ActiveFlag   = rdoStatus.SelectedValue.ToString();
            string strMsg = objTaxFormMaster.SaveData("INSERT_DATA");
            if (objTaxFormMaster.ReturnValue == -1)
            {
                lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
            }
            else
            {
                if (strMsg == "Exists")
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ActivateStatusNotChange, SIMSenuMessageType.UserMessage, false, "");
                }
                else
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.RecordUpdated, SIMSenuMessageType.UserMessage, false, "");
                }
            }
        }

        catch (Exception ex)
        {
            //Writing Error message to File using CommonClass WriteErrorErrFile method taking arguments as URL of page
            // trace, error message
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        objCommonClass.BindDataGrid(gvComm, "uspTaxFormMaster", true, sqlParamSrh, lblRowCount);
        ClearControls();
    }
    protected void imgBtnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            objParameterPossibleValueMaster.Parameter_Id  = Convert.ToInt32(ddlParameter.SelectedValue.ToString());
            objParameterPossibleValueMaster.Possibl_Value = txtPossibleValue.Text.Trim();
            objParameterPossibleValueMaster.Created_By    = Membership.GetUser().UserName.ToString();
            objParameterPossibleValueMaster.Active_Flag   = rdoStatus.SelectedValue.ToString();
            string strMsg;
            strMsg = objParameterPossibleValueMaster.SaveData("INSERT_DATA");

            if (objParameterPossibleValueMaster.ReturnValue == -1)
            {
                lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
            }
            else
            {
                if (strMsg == "Exists")
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DulplicateRecord, SIMSenuMessageType.UserMessage, false, "");
                }
                else
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.AddRecord, SIMSenuMessageType.UserMessage, false, "");
                }
            }
        }
        catch (Exception ex)
        {
            lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        objCommonClass.BindDataGrid(gvComm, "uspParameterPossibleValue", true, sqlParamSrh, lblRowCount);
        ClearControls();
    }
 protected void imgBtnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         //Assigning values to properties
         objSpareStockTransferASC.Stock_Transfer_Id = 0;
         //objSpareStockTransferASC.ASC_Id = ddlASCCode.SelectedValue.ToString();
         objSpareStockTransferASC.ASC_Id             = Convert.ToInt32(hdnASC_Code.Value);
         objSpareStockTransferASC.ProductDivision_Id = Convert.ToInt32(ddlProductDivision.SelectedItem.Value.ToString());
         objSpareStockTransferASC.Spare_Id           = Convert.ToInt32(ddlSpare.SelectedItem.Value.ToString());
         objSpareStockTransferASC.From_Loc_Id        = Convert.ToInt32(ddlFromLocation.SelectedItem.Value.ToString());
         objSpareStockTransferASC.To_Loc_Id          = Convert.ToInt32(ddlToLocation.SelectedItem.Value.ToString());
         objSpareStockTransferASC.Transfered_Qty     = Convert.ToInt32(txtTransferedQty.Text.Trim());
         objSpareStockTransferASC.EmpCode            = Membership.GetUser().UserName.ToString();
         string strMsg = objSpareStockTransferASC.SaveData("INSERT_TRANSFER_LOG");
         if (objSpareStockTransferASC.ReturnValue == -1)
         {
             lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
         }
         else
         {
             lblMessage.Text        = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.StockMoved, SIMSenuMessageType.UserMessage, false, "");
             ddlSpare.SelectedIndex = 0;
             ddlSpare_SelectedIndexChanged(null, null);
             lblStockTransferDocumentNo.Text = "<b><font color='red'>" + strMsg + "</font></b>";
         }
     }
     catch (Exception ex)
     {
         //Writing Error message to File using SIMSCommonClass WriteErrorErrFile method taking arguments as URL of page
         // trace, error message
         SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
     }
     //ClearControls();
 }
Example #7
0
    protected void imgBtnConfirm_Click(object sender, EventArgs e)
    {
        if (SaveAsDraft() == true)
        {
            string strSIMSIndentNo = objSpareRequirementIndentConfirm.GET_SIMS_INDENT_NO();
            objSpareRequirementIndentConfirm.Draft_No       = hdnDraft_No.Value;
            objSpareRequirementIndentConfirm.SIMS_Indent_No = strSIMSIndentNo;
            objSpareRequirementIndentConfirm.PO_Number      = txtPONumber.Text;
            string strMsg = objSpareRequirementIndentConfirm.PushFinalSalesOrder();

            if (strMsg == "")
            {
                lblTransactionName.Text   = "SIMS Indent No:";
                lblTransactionNo.Text     = "<b><font color='red'>" + strSIMSIndentNo + "</font></b>";
                lblMessage.Text           = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.SalesOrderPushed, SIMSenuMessageType.UserMessage, false, "");
                imgBtnDraft.Enabled       = false;
                imgBtnConfirm.Enabled     = false;
                imgBtnDiscard.Enabled     = false;
                lblSAPSalesOrderName.Text = "SAP Sales Order:";
                lblSAPSalesOrderNo.Text   = "<b><font color='red'></font></b>";
                //Add By Binay
                string strMsgSalesOrderStatus = objSpareRequirementIndentConfirm.PushSalesOrderStatus();
                if (strMsgSalesOrderStatus != "")
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.UserMessage, false, "");
                    return;
                }
                //End
            }
        }
    }
    //end
    protected void imgBtnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            if (hdnASC_Spec_Spare_Id.Value != "")
            {
                // CalculateTrigger();
                //Assigning values to properties
                objASCSpecificSpare.ASC_Spec_Spare_Id = int.Parse(hdnASC_Spec_Spare_Id.Value.ToString());
                objASCSpecificSpare.ASC_Id            = Convert.ToInt32(ddlASCCode.SelectedValue.ToString());
                // objASCSpecificSpare.Loc_Id = Convert.ToInt32(ddlLocation.SelectedItem.Value.ToString());
                objASCSpecificSpare.ProductDivision_Id = Convert.ToInt32(ddlProductDivision.SelectedItem.Value.ToString());
                objASCSpecificSpare.Spare_Id           = Convert.ToInt32(ddlSpare.SelectedItem.Value.ToString());

                objASCSpecificSpare.Lead_Time = txtLeadTime.Text.Trim();
                string avgConsumtion     = txtAvgConsumption.Text.Trim();
                double avgConsumtion_int = Convert.ToDouble(avgConsumtion);
                objASCSpecificSpare.AVGConsumption_Per_Day = System.Math.Round(avgConsumtion_int, 2).ToString();
                objASCSpecificSpare.Safety_Percentage      = txtSafety.Text.Trim();
                objASCSpecificSpare.Reorder_Trigger        = txtReorderTrigger.Text.Trim();
                objASCSpecificSpare.Recommended_Stock      = txtRecommendedStock.Text.Trim();
                objASCSpecificSpare.Order_Quantity         = txtOrderQuantity.Text.Trim();
                objASCSpecificSpare.Min_Order_Quantity     = txtMinOrderQty.Text.Trim();
                objASCSpecificSpare.EmpCode    = Membership.GetUser().UserName.ToString();
                objASCSpecificSpare.ActiveFlag = rdoStatus.SelectedValue.ToString();

                string strMsg = objASCSpecificSpare.SaveData("UPDATE_ASC_SPEC_SPARE");
                if (objASCSpecificSpare.ReturnValue == -1)
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
                }
                else
                {
                    if (strMsg == "Exists")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DulplicateRecord, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else if (strMsg == "InUse")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ActivateStatusNotChange, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.RecordUpdated, SIMSenuMessageType.UserMessage, false, "");
                        objCommonClass.BindDataGrid(gvComm, "uspASCSpecificSpareMaster", true, sqlParamSrh, lblRowCount);
                        ClearControls();
                    }
                }
            }
        }

        catch (Exception ex)
        {
            //Writing Error message to File using SIMSCommonClass WriteErrorErrFile method taking arguments as URL of page
            // trace, error message
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        //objCommonClass.BindDataGrid(gvComm, "uspASCSpecificSpareMaster", true, sqlParamSrh, lblRowCount);
        //ClearControls();
    }
 protected void btnConfirm_Click(object sender, EventArgs e)
 {
     try
     {
         if (ViewState["DataTableSpareReqComplt"] != null)
         {
             objSpareRequirementComplaint.DataTableSpareReqComplt = (DataTable)ViewState["DataTableSpareReqComplt"];
             objSpareRequirementComplaint.SaveData();
             lblMessage.Visible = true;
             objSpareRequirementComplaint.ProductDivisionId = Convert.ToInt32(hdnDivSNo.Value);
             objSpareRequirementComplaint.Asc_Code          = Convert.ToInt32(hdnASC_Code.Value);
             objSpareRequirementComplaint.Complaint_No      = lblComplaintNo.Text;
             objSpareRequirementComplaint.GenerateIndent();
             if (!string.IsNullOrEmpty(objSpareRequirementComplaint.IndentNo))
             {
                 lblMessage.Text    = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.AddRecord, SIMSenuMessageType.UserMessage, true, "<b> Advice No. : " + objSpareRequirementComplaint.IndentNo + "</b>");
                 btnConfirm.Enabled = false;
             }
         }
         else
         {
             lblMessage.Visible = true;
             lblMessage.Text    = "Records are not added into Grid!";
         }
     }
     catch (Exception ex)
     {
         SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
     }
 }
Example #10
0
    //end
    protected void imgBtnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            if (hdnLoc_Id.Value != "")
            {
                //Assigning values to properties
                objASCLocMaster.Loc_Id        = int.Parse(hdnLoc_Id.Value.ToString());
                objASCLocMaster.ASC_Id        = hdnASC_Id.Value; //ddlASCCode.SelectedValue.ToString();
                objASCLocMaster.Loc_Code      = txtLocCode.Text.Trim();
                objASCLocMaster.Loc_Name      = txtLocName.Text.Trim();
                objASCLocMaster.Engineer_Code = ddlServiceEng.SelectedItem.Value;
                objASCLocMaster.EmpCode       = Membership.GetUser().UserName.ToString();
                objASCLocMaster.ActiveFlag    = rdoStatus.SelectedValue.ToString();
                //objASCLocMaster.IsDefault_Loc = rdoDefaultLocation.SelectedValue.ToString();
                string strMsg = objASCLocMaster.SaveData("UPDATE_LOCATION");
                if (objASCLocMaster.ReturnValue == -1)
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
                }
                else
                {
                    if (strMsg == "LocCodeExists")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.LocCodeExists, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else if (strMsg == "LocNameExists")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.LocNameExists, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else if (strMsg == "InUse")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ActivateStatusNotChange, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else if (strMsg == "DefaultExists")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DefaultExists, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else
                    {
                        lblMessage.Text      = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.RecordUpdated, SIMSenuMessageType.UserMessage, false, "");
                        sqlParamSrh[4].Value = hdnASC_Id.Value;
                        objCommonClass.BindDataGrid(gvComm, "uspASCLocationMaster", true, sqlParamSrh, lblRowCount);
                        ClearControls();
                    }
                }
            }
        }

        catch (Exception ex)
        {
            //Writing Error message to File using SIMSCommonClass WriteErrorErrFile method taking arguments as URL of page
            // trace, error message
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        //objCommonClass.BindDataGrid(gvComm, "uspASCLocationMaster", true, sqlParamSrh, lblRowCount);
        //ClearControls();
    }
    protected void imgBtnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            if (hdnStockUpdateId.Value != "")
            {
                objStockUpdate.StorageLocId = hdnStockUpdateId.Value;
                objStockUpdate.ASCCode      = ddlASCCode.SelectedItem.Value;
                objStockUpdate.Division     = ddlDivision.SelectedValue.ToString();
                objStockUpdate.SpareCode    = ddlSpareCode.SelectedValue.ToString();
                objStockUpdate.LocId        = ddlLocation.SelectedValue.ToString();
                objStockUpdate.Qty          = txtCurrentStock.Text.Trim();
                objStockUpdate.CGInvoice    = txtCGInvoice.Text.Trim();
                objStockUpdate.ActionBy     = Membership.GetUser().UserName.ToString();
                objStockUpdate.ActionType   = "UPDATE_STOREUPDATE";
                objStockUpdate.SaveStockUpdateMaster();

                if (objStockUpdate.ReturnValue == -1)
                {
                    //MESSAGE AT ERROR IN STORED PROCEDURE

                    SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), objStockUpdate.MessageOut);
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
                }
                else
                {
                    //MESSAGE IF RECORD ALREADY EXIST
                    if (objStockUpdate.MessageOut == "Exists")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DulplicateRecord, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else if (objStockUpdate.MessageOut == "Using in Childs")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ActivateStatusNotChange, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else
                    {
                        //MESSAGE IF RECORD UPDATED SUCCESSFULLY

                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.RecordUpdated, SIMSenuMessageType.UserMessage, false, "");
                        ClearControls();
                    }
                }
            }
        }
        catch (Exception ex)
        {
            lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
            //Writing Error message to File using CommonClass WriteErrorErrFile method taking arguments as URL of page
            // trace, error message
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        finally
        {
            BindGrid();
            FillDropDownToolTip();
        }
    }
Example #12
0
 protected void imgBtnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         int rowIndex = 0;
         foreach (GridViewRow gvr in gvComm.Rows)
         {
             string hdnSpareCode    = ((HiddenField)gvr.FindControl("hdnSpareCode")).Value.ToString().Trim(); //get data from control in TemplateField in each row
             string hdnInterSAP     = ((HiddenField)gvr.FindControl("hdnInterSAP")).Value.ToString().Trim();
             string hdnDivision     = ((HiddenField)gvr.FindControl("hdnDivision")).Value.ToString().Trim();
             string lblSpareCode    = ((Label)gvr.FindControl("lblSpareCode")).Text.Trim();
             string lblIndentNumber = ((Label)gvr.FindControl("lblIndentNumber")).Text.Trim();
             string lblOrdered      = ((Label)gvr.FindControl("lblOrdered")).Text.Trim();
             string lblPending      = ((TextBox)gvr.FindControl("lblPending")).Text.Trim();
             string txtChallanQty   = ((TextBox)gvr.FindControl("txtChallanQty")).Text.Trim();
             string txtReceivedQty  = ((TextBox)gvr.FindControl("txtReceivedQty")).Text.Trim();
             string txtShortfall    = ((TextBox)gvr.FindControl("txtShortfall")).Text.Trim();
             string txtDeffective   = ((TextBox)gvr.FindControl("txtDeffective")).Text.Trim();
             string lblPONumber     = ((Label)gvr.FindControl("lblPONumber")).Text.Trim();
             if (string.IsNullOrEmpty(hdnInterSAP.Trim()))
             {
                 hdnInterSAP = "0";
             }
             objRejectedClaim.ActionBy   = Membership.GetUser().UserName.ToString();
             objRejectedClaim.ActionType = "INSERT_SALESORDER";
             if (objRejectedClaim.ReturnValue == -1)
             {
                 //MESSAGE AT ERROR IN STORED PROCEDURE
                 lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
             }
             else
             {
                 //MESSAGE IF RECORD ALREADY EXIST
                 if (objRejectedClaim.MessageOut == "Exists")
                 {
                     lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DulplicateRecord, SIMSenuMessageType.UserMessage, false, "");
                 }
                 // MESSAGE AT INSERTION
                 else
                 {
                     lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.AddRecord, SIMSenuMessageType.UserMessage, false, "");
                 }
             }
         }
     }
     catch (Exception ex)
     {
         lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
         //Writing Error message to File using CommonClass WriteErrorErrFile method taking arguments as URL of page
         // trace, error message
         SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
     }
     finally
     {
         ClearControls();
     }
 }
Example #13
0
 protected void imgBtnDraft_Click(object sender, EventArgs e)
 {
     if (SaveAsDraft() == true)
     {
         lblTransactionName.Text = "Draft Number:";
         lblTransactionNo.Text   = "<b><font color='red'>" + hdnDraft_No.Value + "</font></b>";
         lblMessage.Text         = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DRAFTSaved, SIMSenuMessageType.UserMessage, false, "");
     }
 }
Example #14
0
    protected void imgbtnInActive_Click(object sender, EventArgs e)
    {
        try
        {
            foreach (GridViewRow gvrow in gvComm.Rows)
            {
                CheckBox chk = (CheckBox)gvrow.FindControl("ChkSpareBOMID");
                if (chk != null & chk.Checked)
                {
                    if (rdoboth.SelectedValue == "1")
                    {
                        objSpareBOMMaster.ActiveFlag = "0";
                    }
                    else if (rdoboth.SelectedValue == "0")
                    {
                        objSpareBOMMaster.ActiveFlag = "1";
                    }
                    objSpareBOMMaster.EmpCode      = Membership.GetUser().UserName.ToString();
                    objSpareBOMMaster.Spare_BOM_Id = Convert.ToInt32(((Label)gvrow.FindControl("lblSpareBOM_ID")).Text);

                    //Calling UpdateSpareBOMStatus to update status of spare BOM Active and Active
                    string strMsg = objSpareBOMMaster.UpdateSpareBOMStatus("UPDATE_SPARE_BOM_STATUS");

                    if (objSpareBOMMaster.ReturnValue == -1)
                    {
                        lblmsgActiveInActive.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
                    }
                    else
                    {
                        if (strMsg == "Exists")
                        {
                            lblmsgActiveInActive.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ActivateStatusNotChange, SIMSenuMessageType.UserMessage, false, "");
                        }
                        else
                        {
                            lblmsgActiveInActive.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.RecordUpdated, SIMSenuMessageType.UserMessage, false, "");
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        if (txtSearch.Text == "")
        {
            objSIMSCommonClass.BindDataGrid(gvComm, "[uspSpareBOMMaster]", true, sqlParamSrh, lblRowCount);
        }
        else
        {
            imgBtnGo_Click(null, null);
        }

        VisibleMakeActiveInactiveButton();
    }
Example #15
0
    //update exisitng records of particular or selected cost center
    protected void imgBtnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            if (hdnCostCenterId.Value != "")
            {
                objCostCenter.CostCenterID   = Convert.ToInt16(hdnCostCenterId.Value);
                objCostCenter.DivisionID     = Convert.ToInt16(ddlDivision.SelectedValue.ToString());
                objCostCenter.CostCenterCode = txtCostCenterCode.Text.Trim();
                objCostCenter.CostCenterDesc = txtCostCenterDesc.Text.Trim();
                objCostCenter.ActionBy       = Membership.GetUser().UserName.ToString();
                objCostCenter.Active_Flag    = Convert.ToInt16(rdoStatus.SelectedValue);
                objCostCenter.BACode         = txtBACode.Text;
                objCostCenter.Type           = "UPDATE_COST_CENTER";
                objCostCenter.UpdateCostCenterMaster();

                if (objCostCenter.ReturnValue == -1)
                {
                    //MESSAGE AT ERROR IN STORED PROCEDURE

                    SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), objCostCenter.MessageOut);
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
                }
                else
                {
                    //MESSAGE IF RECORD ALREADY EXIST
                    if (objCostCenter.MessageOut == "Exists")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DulplicateRecord, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else if (objCostCenter.MessageOut == "Using in Childs")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ActivateStatusNotChange, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else
                    {
                        //MESSAGE IF RECORD UPDATED SUCCESSFULLY

                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.RecordUpdated, SIMSenuMessageType.UserMessage, false, "");
                        ClearFrom();
                    }
                }
            }
        }
        catch (Exception ex)
        {
            lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
            //Writing Error message to File using CommonClass WriteErrorErrFile method taking arguments as URL of page
            // trace, error message
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        finally
        {
            BindGrid();
        }
    }
Example #16
0
    protected void imgBtnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            if (hdnParameterId.Value != "")
            {
                objParameter.ParameterId        = hdnParameterId.Value;
                objParameter.ProductDivision_Id = Convert.ToInt32(ddlDivision.SelectedValue.ToString());
                objParameter.ParameterCode      = txtParameterCode.Text.Trim();
                objParameter.ParameterDesc      = txtParameterDesc.Text.Trim();
                objParameter.ActionBy           = Membership.GetUser().UserName.ToString();
                objParameter.ActiveFlag         = rdoStatus.SelectedValue.ToString();
                objParameter.ActionType         = "UPDATE_PARAMETERMASTER";
                objParameter.SaveParameterMaster();

                if (objParameter.ReturnValue == -1)
                {
                    //MESSAGE AT ERROR IN STORED PROCEDURE

                    SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), objParameter.MessageOut);
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
                }
                else
                {
                    //MESSAGE IF RECORD ALREADY EXIST
                    if (objParameter.MessageOut == "Exists")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DulplicateRecord, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else if (objParameter.MessageOut == "Using in Childs")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ActivateStatusNotChange, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else
                    {
                        //MESSAGE IF RECORD UPDATED SUCCESSFULLY

                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.RecordUpdated, SIMSenuMessageType.UserMessage, false, "");
                        ClearControls();
                    }
                }
            }
        }
        catch (Exception ex)
        {
            lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
            //Writing Error message to File using CommonClass WriteErrorErrFile method taking arguments as URL of page
            // trace, error message
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        finally
        {
            objCommonClass.BindDataGrid(gvComm, "uspParameterMaster", true, sqlParamSrh, lblRowCount);
            //BindGrid();
        }
    }
Example #17
0
    //Add newly mapped cost center with product division
    protected void imgBtnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            if (rdoStatus.SelectedValue == "1")
            {
                objCostCenter.CostCenterCode = txtCostCenterCode.Text;
                objCostCenter.CostCenterDesc = txtCostCenterDesc.Text;
                objCostCenter.BACode         = txtBACode.Text;
                objCostCenter.DivisionID     = Convert.ToInt16(ddlDivision.SelectedValue);
                objCostCenter.ActionBy       = User.Identity.Name;
                objCostCenter.Active_Flag    = 1;
                objCostCenter.Type           = "INSERT_COST_CENTER";
                objCostCenter.SaveCostCenter();
                if (objCostCenter.ReturnValue != -1)
                {
                    if (objCostCenter.MessageOut == "update")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.RecordUpdated, SIMSenuMessageType.UserMessage, false, "");

                        //ClearForm();
                        hdnCostCenterId.Value   = "";
                        rdoStatus.SelectedValue = "1";
                    }
                    else if (objCostCenter.MessageOut == "Insert")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.AddRecord, SIMSenuMessageType.UserMessage, false, "");
                        ClearFrom();
                    }
                    else if (objCostCenter.MessageOut == "Exists")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DulplicateRecord, SIMSenuMessageType.UserMessage, false, "");
                    }
                }
                BindGrid();
            }
            else
            {
                lblMessage.Text = "In-active record can not be created.";
            }
        }
        catch (Exception ex)
        {
            lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
            //Writing Error message to File using CommonClass WriteErrorErrFile method taking arguments as URL of page
            // trace, error message
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
Example #18
0
    protected void imgBtnApprove_Click(object sender, EventArgs e)
    {
        CheckBox    chkreject;
        TextBox     txtRejectionReason;
        Label       lbldocno;
        HiddenField hdnSpareID;
        HiddenField hdnBillNo;
        HiddenField hdnQty;
        String      strSuc = "";

        // bool flgApproved = true;
        foreach (GridViewRow gr in GvDetails.Rows)
        {
            if (gr.RowType == DataControlRowType.DataRow)
            {
                chkreject          = gr.FindControl("chkreject") as CheckBox;
                txtRejectionReason = gr.FindControl("txtRejectionReason") as TextBox;
                lbldocno           = gr.FindControl("lbldocno") as Label;
                hdnSpareID         = gr.FindControl("hdnSpareID") as HiddenField;
                hdnBillNo          = gr.FindControl("hdnBillNo") as HiddenField;
                hdnQty             = gr.FindControl("hdnQty") as HiddenField;
                if (!chkreject.Checked)
                {
                    objASCSparePurchaseOutside.SpareId             = Convert.ToInt32(hdnSpareID.Value);
                    objASCSparePurchaseOutside.AutoGeneratedNumber = lbldocno.Text;
                    objASCSparePurchaseOutside.UserName            = Membership.GetUser().UserName.ToString();
                    objASCSparePurchaseOutside.IsApproved          = true;
                    objASCSparePurchaseOutside.RejectionReason     = txtRejectionReason.Text;
                    strSuc = objASCSparePurchaseOutside.ApprovalBills();
                }
                chkreject.Enabled          = false;
                txtRejectionReason.Enabled = false;
            }
        }

        imgBtnApprove.Enabled = false;
        imgBtnReject.Enabled  = false;
        if (objASCSparePurchaseOutside.ReturnValue == -1)
        {
            lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
        }
        else
        {
            lblMessage.Text = "Bills Approved Sucessfully.";
            objASCSparePurchaseOutside.GetBillsForApproval(GvDetails);
            System.Web.UI.ScriptManager.RegisterClientScriptBlock(imgBtnApprove, GetType(), "Approval", "javascript:CloseAfterApproval();", true);
        }
    }
    protected void imgBtnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            if (hdnBranchSNo.Value != "")
            {
                //Assigning values to properties
                objSIMSBranchMaster.BranchSNo           = int.Parse(hdnBranchSNo.Value.ToString());
                objSIMSBranchMaster.BranchCode          = txtBranchCode.Text.Trim();
                objSIMSBranchMaster.RegionSNo           = int.Parse(ddlRegionDesc.SelectedValue);
                objSIMSBranchMaster.CitySNo             = int.Parse(ddlCity.SelectedValue);
                objSIMSBranchMaster.BranchName          = txtBranchName.Text.Trim();
                objSIMSBranchMaster.BranchAddress       = txtBranchAddress.Text.Trim();
                objSIMSBranchMaster.BranchPlantCode     = txtBranchPlantCode.Text.Trim();
                objSIMSBranchMaster.BranchPlantCodeDesc = txtBranchPlantDesc.Text.Trim();
                objSIMSBranchMaster.EmpCode             = Membership.GetUser().UserName.ToString();
                objSIMSBranchMaster.ActiveFlag          = rdoStatus.SelectedValue.ToString();
                //Calling SaveData to save Branch Master and pass type "UPDATE_BRANCH" it return "" if record
                //is not already exist otherwise exists
                string strMsg = objSIMSBranchMaster.SaveData("UPDATE_BRANCH");
                if (objSIMSBranchMaster.ReturnValue == -1)
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
                }
                else
                {
                    if (strMsg == "Exists")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DulplicateRecord, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.RecordUpdated, SIMSenuMessageType.UserMessage, false, "");
                    }
                }
            }
        }

        catch (Exception ex)
        {
            //Writing Error message to File using CommonClass WriteErrorErrFile method taking arguments as URL of page
            // trace, error message
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        objCommonClass.BindDataGrid(gvComm, "uspSIMSBranchMaster", true, sqlParamSrh, lblRowCount);
        ClearControls();
    }
    protected void imgBtnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            objActivity.Division     = ddlDivision.SelectedValue.ToString();
            objActivity.ActivityCode = txtActivityCode.Text.Trim();
            objActivity.ActivityDesc = txtActivityDesc.Text.Trim();
            objActivity.ActionBy     = Membership.GetUser().UserName.ToString();
            objActivity.ActiveFlag   = rdoStatus.SelectedValue.ToString();
            objActivity.Discount     = txtDiscount.Text;
            objActivity.ActionType   = "INSERT_ACTIVITYMASTER";
            objActivity.SaveActivityMaster();

            if (objActivity.ReturnValue == -1)
            {
                //MESSAGE AT ERROR IN STORED PROCEDURE
                lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
            }
            else
            {
                //MESSAGE IF RECORD ALREADY EXIST
                if (objActivity.MessageOut == "Exists")
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DulplicateRecord, SIMSenuMessageType.UserMessage, false, "");
                }
                //MESSAGE AT INSERTION
                else
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.AddRecord, SIMSenuMessageType.UserMessage, false, "");
                    ClearControls();
                }
            }
        }
        catch (Exception ex)
        {
            lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
            //Writing Error message to File using CommonClass WriteErrorErrFile method taking arguments as URL of page
            // trace, error message
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        finally
        {
            BindGrid();
            ClearControls();
        }
    }
Example #21
0
    protected void imgBtnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            objVendor.Vendor_Code = txtVendorCode.Text.Trim();
            objVendor.Vendor_Name = txtVendorName.Text.Trim();
            objVendor.Address     = txtAddress.Text.Trim();
            objVendor.EmpCode     = Membership.GetUser().UserName.ToString();
            objVendor.ActiveFlag  = rdoStatus.SelectedValue.ToString();

            // added 4 july bhawesh
            if (ddlBranch.SelectedIndex != 0)
            {
                objVendor.Branch_ID = Convert.ToInt32(ddlBranch.SelectedValue);
            }
            else
            {
                objVendor.Branch_ID = 0;
            }
            string strMsg = objVendor.SaveData("INSERT_VENDOR");
            if (objVendor.ReturnValue == -1)
            {
                lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
            }
            else
            {
                if (strMsg == "Exists")
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ActivateStatusNotChange, SIMSenuMessageType.UserMessage, false, "");
                }
                else
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.RecordUpdated, SIMSenuMessageType.UserMessage, false, "");
                }
            }
        }

        catch (Exception ex)
        {
            //Writing Error message to File using CommonClass WriteErrorErrFile method taking arguments as URL of page
            // trace, error message
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        objCommonClass.BindDataGrid(gvComm, "uspVendorMaster", true, sqlParamSrh, lblRowCount);
        ClearControls();
    }
Example #22
0
    //end
    protected void imgBtnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            if (hdnId.Value != "")
            {
                //Assigning values to properties
                objSalesOrderType.Sales_Order_Type_Id   = int.Parse(hdnId.Value.ToString());
                objSalesOrderType.Sales_Order_Type_Code = txtCode.Text.Trim();
                objSalesOrderType.Sales_Order_Type_Desc = txtDescription.Text.Trim();
                objSalesOrderType.EmpCode    = Membership.GetUser().UserName.ToString();
                objSalesOrderType.ActiveFlag = rdoStatus.SelectedValue.ToString();
                string strMsg = objSalesOrderType.SaveData("UPDATE_SALES_ORDER_TYPE");
                if (objSalesOrderType.ReturnValue == -1)
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
                }
                else
                {
                    if (strMsg == "Exists")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DulplicateRecord, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else if (strMsg == "InUse")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ActivateStatusNotChange, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.RecordUpdated, SIMSenuMessageType.UserMessage, false, "");
                        objCommonClass.BindDataGrid(gvComm, "uspSalesOrderType", true, sqlParamSrh, lblRowCount);
                        ClearControls();
                    }
                }
            }
        }

        catch (Exception ex)
        {
            //Writing Error message to File using SIMSCommonClass WriteErrorErrFile method taking arguments as URL of page
            // trace, error message
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        //objCommonClass.BindDataGrid(gvComm, "uspSalesOrderType", true, sqlParamSrh, lblRowCount);
        //ClearControls();
    }
 //end
 protected void imgBtnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         //Assigning values to properties
         objFGIntermediateScreen.ProductSNo  = 0;
         objFGIntermediateScreen.ProductCode = ddlProduct.SelectedValue.ToString();
         string[] Product_Desc = ddlProduct.SelectedItem.ToString().Split('(');
         foreach (string prod_desc in Product_Desc)
         {
             objFGIntermediateScreen.ProductDesc = prod_desc.ToString().Trim();
             break;
         }
         objFGIntermediateScreen.ProductGroup_SNo = int.Parse(ddlProductGroup.SelectedValue.ToString());
         objFGIntermediateScreen.Rating_Status    = ddlRating.SelectedValue.ToString();
         objFGIntermediateScreen.EmpCode          = Membership.GetUser().UserName.ToString();
         objFGIntermediateScreen.ActiveFlag       = rdoStatus.SelectedValue.ToString();
         //Calling SaveData to save Product details and pass type "INSERT_PRODUCT" it return "" if record
         //is not already exist otherwise exists
         string strMsg = objFGIntermediateScreen.SaveData("INSERT_PRODUCT");
         if (objFGIntermediateScreen.ReturnValue == -1)
         {
             lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
         }
         else
         {
             if (strMsg == "Exists")
             {
                 lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DulplicateRecord, SIMSenuMessageType.UserMessage, false, "");
             }
             else
             {
                 lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.AddRecord, SIMSenuMessageType.UserMessage, false, "");
             }
         }
     }
     catch (Exception ex)
     {
         //Writing Error message to File using SIMSCommonClass WriteErrorErrFile method taking arguments as URL of page
         // trace, error message
         SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
     }
     objCommonClass.BindDataGrid(gvComm, "uspFGIntermediate", true, sqlParamSrh, lblRowCount);
     objFGIntermediateScreen.BindDDLProduct(ddlProduct);
     ClearControls();
 }
    protected void imgBtnCancel_Click(object sender, EventArgs e)
    {
        bool   flag   = false;
        string strMsg = string.Empty;

        // InActive All selected Indents
        foreach (GridViewRow gr in gvComm.Rows)
        {
            if (gr.RowType == DataControlRowType.DataRow)
            {
                HiddenField hdnsparepropid = (HiddenField)gr.FindControl("hdnsparepropid");
                CheckBox    ChkConfirm     = (CheckBox)gr.FindControl("ChkConfirm");
                if (ChkConfirm.Checked)
                {
                    flag = true;
                    objSpareRequirementIndent.EmpCode     = Membership.GetUser().UserName.ToString();
                    objSpareRequirementIndent.Proposal_Id = Convert.ToInt16(hdnsparepropid.Value);
                    strMsg = objSpareRequirementIndent.DeleteProposal("DELETE_PROPOSAL");
                    if (objSpareRequirementIndent.ReturnValue == -1)
                    {
                        lblMessage.Text = lblMessage.Text + SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
                    }
                }
            }
        }
        if (flag && strMsg == string.Empty)
        {
            sqlParamSrh[1].Value = hdnASC_Code.Value;
            if (ddlSpareDivision.SelectedIndex > 0)
            {
                sqlParamSrh[2].Value = ddlSpareDivision.SelectedItem.Value;
            }
            else
            {
                sqlParamSrh[2].Value = "0";
            }
            objCommonClass.BindDataGrid(gvComm, "uspSpareRequirementIndent", true, sqlParamSrh, lblRowCount);
            ClearControls();
            lblMessage.Text = "Indent cancelled sucessfully.";
        }
        //ClearControls();
        //lblMessage.Text = "";
    }
Example #25
0
    protected void imgBtnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            if (hdnVendor_Id.Value != "")
            {
                //Assigning values to properties
                objVendor.Vendor_Id   = Convert.ToInt32(hdnVendor_Id.Value);
                objVendor.Vendor_Code = txtVendorCode.Text.Trim();
                objVendor.Vendor_Name = txtVendorName.Text.Trim();
                if (ddlBranch.SelectedIndex != 0)
                {
                    objVendor.Branch_ID = Convert.ToInt32(ddlBranch.SelectedValue);
                }
                objVendor.Address    = txtAddress.Text.Trim();
                objVendor.EmpCode    = Membership.GetUser().UserName.ToString();
                objVendor.ActiveFlag = rdoStatus.SelectedValue.ToString();
                string strMsg = objVendor.SaveData("UPDATE_VENDOR");
                if (objVendor.ReturnValue == -1)
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
                }
                else
                {
                    if (strMsg == "Exists")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ActivateStatusNotChange, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.RecordUpdated, SIMSenuMessageType.UserMessage, false, "");
                    }
                }
            }
        }

        catch (Exception ex)
        {
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        objCommonClass.BindDataGrid(gvComm, "uspVendorMaster", true, sqlParamSrh, lblRowCount);
        ClearControls();
    }
Example #26
0
 //Bind records of cost centers mapped with product divisions based on search criteria's
 private void BindGrid()
 {
     try
     {
         objCostCenter.Type           = "SEARCH";
         objCostCenter.SearchCriteria = txtSearch.Text.Trim();
         objCostCenter.Active_Flag    = Convert.ToInt16(rdoboth.SelectedValue);
         objCostCenter.SortColumnName = ViewState["Column"].ToString();
         objCostCenter.ColumnName     = ddlSearch.SelectedValue;
         objCostCenter.SortOrder      = ViewState["Order"].ToString();
         objCostCenter.BindGridSAPCostCenterMasterSearch(gvCostCenter, lblRowCount);
     }
     catch (Exception ex)
     {
         lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
         //Writing Error message to File using CommonClass WriteErrorErrFile method taking arguments as URL of page
         // trace, error message
         SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
     }
 }
Example #27
0
    protected void imgBtnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            if (hdnActivityParameterMapping_Id.Value != "")
            {
                objActivityParameterMappingMaster.ActivityParameterMapping_Id = Convert.ToInt32(hdnActivityParameterMapping_Id.Value.ToString());
                objActivityParameterMappingMaster.ProductDivision_Id          = Convert.ToInt32(ddlProductDivisionId.SelectedValue);
                objActivityParameterMappingMaster.Activity_Id  = Convert.ToInt32(ddlActivity.SelectedValue);
                objActivityParameterMappingMaster.Parameter_Id = Convert.ToInt32(ddlParameter.SelectedValue);
                objActivityParameterMappingMaster.EmpCode      = Membership.GetUser().UserName.ToString();
                objActivityParameterMappingMaster.Active_Flag  = rdoStatus.SelectedValue.ToString();

                string strMsg = objActivityParameterMappingMaster.SaveData("UPDATE_DATA");
                if (objActivityParameterMappingMaster.ReturnValue == -1)
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
                }
                else
                {
                    if (strMsg == "Exists")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DulplicateRecord, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.RecordUpdated, SIMSenuMessageType.UserMessage, false, "");
                    }
                }
            }
        }

        catch (Exception ex)
        {
            //Writing Error message to File using CommonClass WriteErrorErrFile method taking arguments as URL of page
            // trace, error message
            CommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        objCommonClass.BindDataGrid(gvComm, "uspActivityParameterMapping", true, sqlParamSrh, lblRowCount);
        ClearControls();
    }
 protected void imgBtnUpdateFGIntmd_Click(object sender, EventArgs e)
 {
     try
     {
         if (hdnProductSNo.Value != "")
         {
             //Assigning values to properties
             objFGIntermediateScreen.ProductSNo         = int.Parse(hdnProductSNo.Value.ToString());
             objFGIntermediateScreen.ProductCodeFGIntmd = txtProductCode.Text.Trim();
             objFGIntermediateScreen.ProductDescFGIntmd = txtProductDesc.Text.Trim();
             objFGIntermediateScreen.ProductMappingFlag = rdoProdMapping.SelectedValue.ToString();
             objFGIntermediateScreen.EmpCode            = Membership.GetUser().UserName.ToString();
             string strMsg = objFGIntermediateScreen.SaveDataFGIntermediate("UPDATE_PRODUCT_FG_INTERMEDIATE");
             if (objFGIntermediateScreen.ReturnValue == -1)
             {
                 lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
             }
             else
             {
                 if (strMsg == "Exists")
                 {
                     lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DulplicateRecord, SIMSenuMessageType.UserMessage, false, "");
                 }
                 else
                 {
                     lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.RecordUpdated, SIMSenuMessageType.UserMessage, false, "");
                 }
             }
         }
     }
     catch (Exception ex)
     {
         //Writing Error message to File using SIMSCommonClass WriteErrorErrFile method taking arguments as URL of page
         // trace, error message
         SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
     }
     objCommonClass.BindDataGrid(gvComm, "uspFGIntermediate", true, sqlParamSrh, lblRowCount);
     objFGIntermediateScreen.BindDDLProduct(ddlProduct);
     ClearControls();
     imgBtnAddFGIntmd.Visible = true;
 }
Example #29
0
    protected void imgBtnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            if (hdnSpareConsume_Id.Value != "")
            {
                //Assigning values to properties
                objSpareConsumeMaster.SpareConsume_Id   = Convert.ToInt32(hdnSpareConsume_Id.Value);
                objSpareConsumeMaster.SpareConsume_Code = txtcode.Text.Trim();
                objSpareConsumeMaster.SpareConsume_Desc = txtDescription.Text.Trim();
                objSpareConsumeMaster.Action_Type       = Convert.ToInt32(ddlActionType.SelectedValue);
                objSpareConsumeMaster.EmpCode           = Membership.GetUser().UserName.ToString();
                objSpareConsumeMaster.ActiveFlag        = rdoStatus.SelectedValue.ToString();
                string strMsg = objSpareConsumeMaster.SaveData("UPDATE_SPARE_CONSUME");
                if (objSpareConsumeMaster.ReturnValue == -1)
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
                }
                else
                {
                    if (strMsg == "Exists")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ActivateStatusNotChange, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.RecordUpdated, SIMSenuMessageType.UserMessage, false, "");
                    }
                }
            }
        }

        catch (Exception ex)
        {
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        objCommonClass.BindDataGrid(gvComm, "uspSpareConsume", true, sqlParamSrh, lblRowCount);
        ClearControls();
    }
Example #30
0
    protected void imgBtnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            if (hdnSpareMapping_Id.Value != "")
            {
                //Assigning values to properties
                objSpareMappingMaster.SpareMapping_Id    = Convert.ToInt32(hdnSpareMapping_Id.Value);
                objSpareMappingMaster.Vendor_Id          = Convert.ToInt32(ddlVendorCode.SelectedValue);
                objSpareMappingMaster.ProductDivision_Id = Convert.ToInt32(ddlDivision.SelectedValue);
                objSpareMappingMaster.Spare_BOM_Id       = Convert.ToInt32(ddlSpare.SelectedValue);
                objSpareMappingMaster.EmpCode            = Membership.GetUser().UserName.ToString();
                objSpareMappingMaster.ActiveFlag         = rdoStatus.SelectedValue.ToString();
                string strMsg = objSpareMappingMaster.SaveData("UPDATE_SPAREMAPPING");
                if (objSpareMappingMaster.ReturnValue == -1)
                {
                    lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.ErrorInStoreProc, SIMSenuMessageType.Error, false, "");
                }
                else
                {
                    if (strMsg == "Exists")
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.DulplicateRecord, SIMSenuMessageType.UserMessage, false, "");
                    }
                    else
                    {
                        lblMessage.Text = SIMSCommonClass.getErrorWarrning(SIMSenuErrorWarrning.RecordUpdated, SIMSenuMessageType.UserMessage, false, "");
                    }
                }
            }
        }

        catch (Exception ex)
        {
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        objCommonClass.BindDataGrid(gvComm, "uspVendorSpareMapping", true, sqlParamSrh, lblRowCount);
        ClearControls();
    }