Exemple #1
0
 private void BindInternalBillSummary()
 {
     try
     {
         objASCPayMaster.RegionSNo            = Convert.ToInt32(ddlRegion.SelectedValue);
         objASCPayMaster.ProductDivisionSNo   = Convert.ToInt32(ddlProductDivison.SelectedValue);
         objASCPayMaster.ServiceContractorSNo = Convert.ToInt32(DDlAsc.SelectedValue);
         objASCPayMaster.BranchSNo            = Convert.ToInt32(ddlBranch.SelectedValue);
         objASCPayMaster.ColumnName           = ViewState["Column"].ToString();
         objASCPayMaster.SortOrder            = ViewState["Order"].ToString();
         objASCPayMaster.LoggedDateFrom       = txtFromDate.Text.Trim();
         objASCPayMaster.LoggedDateTo         = txtToDate.Text.Trim();
         objASCPayMaster.BindInternalBillDetails(gvBillSummary, lblRowCount);
         if (lblRowCount.Text.Trim() != "0")
         {
             btnExportExcel.Visible = true;
         }
         else
         {
             btnExportExcel.Visible = false;
         }
         if (objASCPayMaster.ReturnValue == -1)
         {
             SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), objASCPayMaster.MessageOut);
         }
     }
     catch (Exception ex)
     {
         SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
     }
 }
Exemple #2
0
    private void BindgvConfirmation()
    {
        try
        {
            TimeSpan duration1 = new TimeSpan(0, 0, 0, 0);
            TimeSpan duration2 = new TimeSpan(0, 23, 59, 59);

            if (ddlRegion.SelectedIndex > 0 || ddlRegion.SelectedValue != "0") // Bhawesh added 25 June 13
            {
                objSpareRequirementComplaint.RegionSNo = Convert.ToInt32(ddlRegion.SelectedValue);
            }
            if (ddlBranch.SelectedIndex > 0)
            {
                objSpareRequirementComplaint.BranchSNo = Convert.ToInt32(ddlBranch.SelectedValue);
            }
            if (ddlASC.SelectedIndex > 0)
            {
                objSpareRequirementComplaint.Asc_Code = Convert.ToInt32(ddlASC.SelectedValue);
            }
            if (ddlProductDiv.SelectedIndex > 0)
            {
                objSpareRequirementComplaint.ProductDivisionId = Convert.ToInt32(ddlProductDiv.SelectedValue);
            }

            objSpareRequirementComplaint.FromDate = Convert.ToDateTime(txtFromDate.Text).Add(duration1);
            objSpareRequirementComplaint.ToDate   = Convert.ToDateTime(txtToDate.Text).Add(duration2);

            objSpareRequirementComplaint.BindNonClosureComplaint(gvConfirmation, lblRowCount);
        }

        catch (Exception ex)
        {
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
Exemple #3
0
 private void BindGridView()
 {
     try
     {
         strPO_Number = Request.QueryString["pono"].ToString();
         //strPO_Number = "PO250";
         DataSet ds = new DataSet();
         ds = objCommonPopUp.BindSalesOrderHistoryLog(strPO_Number);
         if (ds.Tables[0].Rows.Count > 0)
         {
             trPonumber.Visible   = true;
             lblPoNumber.Text     = ds.Tables[0].Rows[0]["PO_Number"].ToString();
             gvHistory.DataSource = objCommonPopUp.BindSalesOrderHistoryLog(strPO_Number);
             gvHistory.DataBind();
         }
         else
         {
             lblPoNumber.Text     = "";
             trPonumber.Visible   = false;
             gvHistory.DataSource = objCommonPopUp.BindSalesOrderHistoryLog(strPO_Number);
             gvHistory.DataBind();
         }
         if (objCommonPopUp.ReturnValue == -1)
         {
             SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), objCommonPopUp.MessageOut);
         }
     }
     catch (Exception ex)
     {
         SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
     }
 }
Exemple #4
0
    //fill details of selected payment
    protected void gvConfirmedPayment_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            if (e.CommandName == "Trans")
            {
                divTransactionDetail.Visible  = true;
                objASCPayMaster.TransactionNo = Convert.ToString(e.CommandArgument);
                objASCPayMaster.ColumnName    = ViewState["Column"].ToString();
                objASCPayMaster.SortOrder     = ViewState["Order"].ToString();
                objASCPayMaster.BindTransactionDetails(gvTransactionDetail, lblRowCount);
            }
            if (e.CommandName == "Download")
            {
                UpdateDownloadedFileStatus(e.CommandArgument.ToString());

                string f = Server.MapPath("~/SIMS/SAPFilesUAT/") + e.CommandArgument;
                (e.CommandSource as LinkButton).Text = f;
                Response.ContentType = "txt";
                Response.AppendHeader("Content-Disposition", "attachment; filename=" + e.CommandArgument);
                Response.TransmitFile(f);
                Response.End();

                //  DownloadFileForIndividualPayment(e.CommandArgument.ToString(),e.CommandSource as LinkButton);
            }
        }

        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());
        }
    }
Exemple #5
0
    //bind claim/s of requested bills to approve or reject it
    private void BindgvConfirmation()
    {
        try
        {
            if (!(string.IsNullOrEmpty((string)Request.QueryString["asc"]) && string.IsNullOrEmpty((string)Request.QueryString["division"]) && string.IsNullOrEmpty((string)Request.QueryString["bill"])))
            {
                ASCPaymentMaster objASCPayMaster = new ASCPaymentMaster();//create object to reload form after approval or rejection of claim/s of respected bill/s
                // objASCPayMaster = (ASCPaymentMaster)Session["SCP"];

                if (Session["BillPOPUpOpenDate"] != null)
                {
                    String[] dates = Convert.ToString(Session["BillPOPUpOpenDate"]).Split(new char[] { ',' });
                    objASCPayMaster.LoggedDateFrom = dates[0];
                    objASCPayMaster.LoggedDateTo   = dates[1];
                }

                objASCPayMaster.ServiceContractorSNo = Convert.ToInt16(Request.QueryString["asc"]);
                objASCPayMaster.ProductDivisionSNo   = Convert.ToInt16(Request.QueryString["division"]);
                objASCPayMaster.BillNo = Convert.ToString(Request.QueryString["bill"]);
                objASCPayMaster.BindGridBillDetails(gvConfirmation, lblRowCount);
            }
            else
            {
                gvConfirmation.DataSource = null;
                gvConfirmation.DataBind();
            }
        }

        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());
        }
    }
Exemple #6
0
    private void BindActivityGridView()
    {
        try
        {
            strComplaint_No = Request.QueryString["compNo"].ToString();
            //strComplaint_No = "0912001458/01";
            DataSet ds = new DataSet();
            ds = objCommonPopUp.BindActivityDetailsinGried(strComplaint_No);
            if (ds.Tables.Count > 0 && (lblProductDivision.Text.IndexOf("Appliance") >= 0) && ComplaintDate < Convert.ToInt32(lblComplaintNo.Text.Split('/')[0].Replace("I", "")))
            {
                if (ds.Tables[0].Rows[0]["ActivityType"].ToString().Trim() == "L")
                {
                    lblConyvanceType.Text = "<b>Charge Type</b> : Local";
                }
                else if (ds.Tables[0].Rows[0]["ActivityType"].ToString().Trim() == "O")
                {
                    lblConyvanceType.Text = "<b>Travel Mode</b> : OutStation";
                }
            }
            gvActivityHistory.DataSource = ds;
            gvActivityHistory.DataBind();


            if (objCommonPopUp.ReturnValue == -1)
            {
                SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), objCommonPopUp.MessageOut);
            }
        }
        catch (Exception ex)
        {
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
    void BindConfirmedPayments()
    {
        try
        {
            objASCPayMaster.ProductDivisionSNo = Convert.ToInt32(ddlProductDivison.SelectedValue);
            objASCPayMaster.BranchSNo          = Convert.ToInt32(ddlBranch.SelectedValue);
            objASCPayMaster.TransactionNo      = "";
            objASCPayMaster.LoggedDateFrom     = txtFromDate.Text.Trim();
            objASCPayMaster.LoggedDateTo       = txtToDate.Text.Trim();
            DataTable dt;
            objASCPayMaster.BillPaymentSummary(gvConfirmedPayment, lblRowCount, out dt);
            gvTransactionDetail.DataSource = dt;
            gvTransactionDetail.DataBind();
            if (dt.Rows.Count > 0)
            {
                btnExport.Visible = true;
            }
            if (objASCPayMaster.ReturnValue == -1)
            {
                SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), objASCPayMaster.MessageOut);
            }
        }

        catch (Exception ex)
        {
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
    protected void imgBtnApprove_Click(object sender, EventArgs e)
    {
        try
        {
            string uName = Membership.GetUser().UserName;
            foreach (GridViewRow item in gvSummary.Rows)
            {
                CheckBox chk = (CheckBox)item.FindControl("chkSelect");
                if (chk.Checked)
                {
                    LinkButton   lnkcomplaint = (LinkButton)item.FindControl("lnkcomplaint");
                    DropDownList ddlactivity  = (DropDownList)item.FindControl("ComplaintTypes");
                    string       wipdate      = Convert.ToString(((HiddenField)item.FindControl("HdnWIPEndDate")).Value);


                    string activity = "";
                    if (ddlactivity.SelectedValue != "")
                    {  // get carry forward
                        activity = ddlactivity.SelectedValue;
                    }

                    string complaint_no = lnkcomplaint.Text.Trim();
                    int    IsApproved   = 1;
                    //int msg = objSqlDataAccessLayer.ExecuteNonQuery(CommandType.Text, "update tbl_ComplaintActivityTypeFan set IsApproved=1,ApprovedId= '" + uName + "' where Complaint_no ='" + complaint_no + "'");
                    ClaimApprovalFan(complaint_no, IsApproved, "", uName, 1, activity, wipdate);// used type 1 (same as IsApproved value  ) in sp to update above query
                }
            }
            ShowReport();
            BindSummaryGrid(Convert.ToInt32(hdnIndex.Value));
        }
        catch (Exception ex)
        {
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
    //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();
    }
Exemple #10
0
 protected void GvSpareSalePurchaseByASC_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     try
     {
         if (e.Row.RowType == DataControlRowType.DataRow)
         {
             Button btnDeleteRow = (Button)e.Row.FindControl("btnDeleteRow");
             Button btnAddRow    = (Button)e.Row.FindControl("btnAddRow");
             Button btnCancelRow = (Button)e.Row.FindControl("btnCancelRow");
             if (e.Row.RowIndex != Convert.ToInt32(ViewState["EditIndex"]))
             {
                 btnAddRow.Visible    = false;
                 btnCancelRow.Visible = false;
             }
             else
             {
                 btnDeleteRow.Visible = false;
             }
         }
         if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.Header)
         {
             e.Row.Cells[10].Visible = false;
         }
     }
     catch (Exception ex)
     {
         SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
     }
 }
Exemple #11
0
    private void Fn_Create_Table()
    {
        try
        {
            DTSparePurchaseOutside = new DataTable();

            DTSparePurchaseOutside.Columns.Add("Spare_Id");
            DTSparePurchaseOutside.Columns.Add("Spare");
            DTSparePurchaseOutside.Columns.Add("Vendor_Id");
            DTSparePurchaseOutside.Columns.Add("Vendor");
            DTSparePurchaseOutside.Columns.Add("Quantity");
            DTSparePurchaseOutside.Columns.Add("BillNo");
            DTSparePurchaseOutside.Columns.Add("BillDate");
            DTSparePurchaseOutside.Columns.Add("Amount");

            DTSparePurchaseOutside.Columns.Add("Rate");
            DTSparePurchaseOutside.Columns.Add("PurchasedRate");
            DTSparePurchaseOutside.Columns.Add("Comments");

            DTSparePurchaseOutside.AcceptChanges();
            ViewState["DataTableSparePurchaseOutside"] = DTSparePurchaseOutside;
        }
        catch (Exception ex)
        {
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
Exemple #12
0
    protected void imgBtnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            if (IsValid())
            {
                foreach (GridViewRow item in gvSummary.Rows)
                {
                    CheckBox chk = (CheckBox)item.FindControl("chkSelect");
                    if (chk.Checked)
                    {
                        string  complaint_no = item.Cells[2].Text;
                        TextBox txt          = (TextBox)item.FindControl("txtcomment");
                        string  comment      = txt.Text;

                        int msg = objSqlDataAccessLayer.ExecuteNonQuery(CommandType.Text, "update tbl_ComplaintActivityTypeFan set IsReApprovalSent=1,ASCComment='" + comment + "' where Complaint_no ='" + complaint_no + "'");
                    }
                }
                lblMessage.Text = "";
                lblSuccess.Text = "Sent For Approval";
                BindSummaryGrid();
            }
            else
            {
                lblMessage.Text = "Please Enter Comment in Selected Complaint";
            }
        }
        catch (Exception ex)
        {
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
Exemple #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            try
            {
                string dt = Convert.ToString(DateTime.Now.Date.Day);
                if ((dt == "2") || (dt == "3") || (dt == "4") || (dt == "5"))   ///date for showing page to ASC
                {
                    ddlmnth.SelectedValue = Convert.ToString(DateTime.Now.Month - 1);
                    ddlYear.SelectedValue = Convert.ToString(DateTime.Now.Year);
                    imgBtnAdd.Visible     = false;
                    imgBtnCancel.Visible  = false;
                    imgBtnSave.Visible    = false;
                }
                else
                {
                    Response.Redirect("~/Pages/Default.aspx");
                }
            }
            catch (Exception ex)
            {
                SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
            }
        }


        System.Threading.Thread.Sleep(Convert.ToInt32(ConfigurationManager.AppSettings["AjaxPleaseWaitTime"]));
    }
Exemple #14
0
    protected void ddlDivision_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            lblMessage.Text = "";
            ObjSpareServiceActivity.ProductDiv = ddlDivision.SelectedValue;
            //ObjSpareServiceActivity.ASC = Membership.GetUser().UserName.ToString();

            ObjSpareServiceActivity.ASC = ddlASC.SelectedValue;

            DataSet ds = new DataSet();
            ds = ObjSpareServiceActivity.BindData();
            lblRowCount.Text           = Convert.ToString(ds.Tables[0].Rows.Count);
            gvChallanDetail.DataSource = ds;
            gvChallanDetail.DataBind();
            if (ds.Tables[0].Rows.Count > 0)
            {
                imgBtnConfirm.Visible = true;
                ImgBtnCancel.Visible  = true;
            }
            else
            {
                imgBtnConfirm.Visible = false;
                ImgBtnCancel.Visible  = false;
            }
            Session["ASC"] = ddlASC.SelectedValue;
            Session["div"] = ddlDivision.SelectedValue;
        }
        catch (Exception ex)
        {
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
Exemple #15
0
    private void Fn_Create_Table()
    {
        try
        {
            DTSpareSalePurchaseByASC = new DataTable();

            DTSpareSalePurchaseByASC.Columns.Add("Spare_Id");
            DTSpareSalePurchaseByASC.Columns.Add("Loc_Id");
            DTSpareSalePurchaseByASC.Columns.Add("Def_Loc_Id");
            DTSpareSalePurchaseByASC.Columns.Add("Current_Stock");
            DTSpareSalePurchaseByASC.Columns.Add("Quantity");
            DTSpareSalePurchaseByASC.Columns.Add("QtyAsPerLocation");
            DTSpareSalePurchaseByASC.Columns.Add("Action_Type");
            DTSpareSalePurchaseByASC.Columns.Add("Action_Type_Id");
            DTSpareSalePurchaseByASC.Columns.Add("Location");
            DTSpareSalePurchaseByASC.Columns.Add("Def_Location");
            DTSpareSalePurchaseByASC.Columns.Add("Spare");
            DTSpareSalePurchaseByASC.Columns.Add("Comments");

            DTSpareSalePurchaseByASC.AcceptChanges();
            ViewState["DataTableSpareSalePurchaseByASC"] = DTSpareSalePurchaseByASC;
        }
        catch (Exception ex)
        {
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                string Rep = Request.QueryString["Rep"];
                if (Rep == "true")
                {
                    dvreprint.Style.Add("display", "block");
                }

                lbltransactionno.Text    = Request.QueryString["BillNo"];
                ObjPrintInternalBill.IBN = lbltransactionno.Text;
                string ASC_Id = Request.QueryString["ASC"];
                ObjPrintInternalBill.GetAscAddress(ASC_Id);
                lblDivision.Text                   = ObjPrintInternalBill.ProductDivision;
                lblasc.Text                        = ObjPrintInternalBill.AscName;
                lblascaddress.Text                 = ObjPrintInternalBill.Address;
                lblbranch.Text                     = ObjPrintInternalBill.BranchName;
                lblbranchaddress.Text              = ObjPrintInternalBill.BranchAddress;
                ObjPrintInternalBill.AscName       = ASC_Id;
                ObjPrintInternalBill.transactionno = lbltransactionno.Text;
                BindGridView();
            }
        }
        catch (Exception ex)
        {
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
    }
Exemple #17
0
 protected void ddlProdDivision_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         trTransaction.Visible = false;
         lblTransactionNo.Text = "";
         txtFindSpare.Text     = "";
         btnConfirm.Enabled    = true;
         if (ddlProdDivision.SelectedIndex != 0)
         {
             // sync 30
             objSpareSalePurchaseByASC.Asc_Code = Convert.ToInt32(hdnASC_Code.Value);
             objSpareSalePurchaseByASC.BindDDLVendor(ddlVendor, Convert.ToInt32(ddlProdDivision.SelectedValue));
             Fn_GetCurrentDataTable();
         }
         else
         {
             ddlVendor.Items.Clear();
             ddlVendor.Items.Insert(0, new ListItem("Select", "0"));
         }
     }
     catch (Exception ex)
     {
         SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
     }
     FillDropDownToolTip();
 }
    public DataTable Fn_AddNewRow()
    {
        try
        {
            if (ViewState["DataTableSpareReqComplt"] != null)
            {
                DTSpareReqComplt = (DataTable)ViewState["DataTableSpareReqComplt"];
                Asc_Code         = Convert.ToInt32(hdnASC_Code.Value.ToString());

                DataRow dr = DTSpareReqComplt.NewRow();
                dr["ASC_Id"]             = Asc_Code;
                dr["ProductDivision_Id"] = hdnDivSNo.Value;
                dr["Product_SNo"]        = hdnProdSNo.Value;
                dr["Complaint_No"]       = lblComplaintNo.Text;
                dr["Created_By"]         = Membership.GetUser().UserName;
                dr["Created_Date"]       = System.DateTime.Now;
                dr["Active_Flag"]        = 0;

                DTSpareReqComplt.Rows.Add(dr);
                ViewState["DataTableSpareReqComplt"] = DTSpareReqComplt;
            }
        }
        catch (Exception ex)
        {
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
        }
        return(DTSpareReqComplt);
    }
Exemple #19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         try
         {
             if (Page.Request.QueryString["transactionno"] != null)
             {
                 hdn_Ordered_Transaction_No.Value = Convert.ToString(Page.Request.QueryString["transactionno"]);
             }
             objDeliverySchedule.Ordered_Transaction_No = hdn_Ordered_Transaction_No.Value;
             objDeliverySchedule.SelectSpareDetail();
             lblSpare.Text      = objDeliverySchedule.Spare_Name;
             hdnSpare_Id.Value  = objDeliverySchedule.Spare_Id.ToString();
             lblOrderedQty.Text = objDeliverySchedule.Quantity.ToString();
             FillDeliveryGrid();
         }
         catch (Exception ex)
         {
             //Response.Redirect("../../Pages/Default.aspx");
             SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
         }
     }
     System.Threading.Thread.Sleep(int.Parse(ConfigurationManager.AppSettings["AjaxPleaseWaitTime"]));
 }
 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());
     }
 }
Exemple #21
0
    private void BindConfirmedPayments()
    {
        try
        {
            objASCPayMaster.RegionSNo            = Convert.ToInt32(ddlRegion.SelectedValue); // Bhawesh Add : 19-7-13
            objASCPayMaster.ProductDivisionSNo   = Convert.ToInt32(ddlProductDivison.SelectedValue);
            objASCPayMaster.ServiceContractorSNo = Convert.ToInt32(DDlAsc.SelectedValue);
            objASCPayMaster.BranchSNo            = Convert.ToInt32(ddlBranch.SelectedValue);
            objASCPayMaster.TransactionNo        = "";
            objASCPayMaster.ColumnName           = ViewState["Column"].ToString();
            objASCPayMaster.SortOrder            = ViewState["Order"].ToString();

            // Added By Bhawesh 19 Sept 12 for date range search
            objASCPayMaster.LoggedDateFrom = txtFromDate.Text.Trim();
            objASCPayMaster.LoggedDateTo   = txtToDate.Text.Trim();

            objASCPayMaster.BindConfirmedPaymentReport(gvConfirmedPayment, lblRowCount);
            if (objASCPayMaster.ReturnValue == -1)
            {
                SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), objASCPayMaster.MessageOut);
            }
        }

        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());
        }
    }
Exemple #22
0
 protected void ddlRegion_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         objCommonMIS.RegionSno = ddlRegion.SelectedValue;
         objCommonMIS.GetUserBranchs(ddlBranch);
         if (ddlBranch.Items.Count == 2)
         {
             ddlBranch.SelectedIndex = 1;
         }
         objCommonMIS.BranchSno = ddlBranch.SelectedValue;
         objCommonMIS.GetUserSCs(ddlASC);
         if (ddlASC.Items.Count == 2)
         {
             ddlASC.SelectedIndex = 1;
         }
         objSpareConsumption.ASC_Id = 0;
         objSpareConsumption.BindProductDivisionData(ddlProductDivison);
     }
     catch (Exception ex)
     {
         SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
     }
     FillASCDropDownToolTip();
     FillRegionDropDownToolTip();
     FillBranchDropDownToolTip();
     FillDivisionDropDownToolTip();
 }
Exemple #23
0
 protected void BindGridView()
 {
     try
     {
         lblMessage.Text = "";
         SqlParameter[] sqlParamS =
         {
             new SqlParameter("@ASC_Id",             hdnASC_Id.Value),
             new SqlParameter("@ProductDivision_Id", ddlDivision.SelectedValue),
             new SqlParameter("@Type",               "GET_DATA"),
             new SqlParameter("@Activity_id",        ddlServiceSpares.SelectedValue),
             new SqlParameter("@Item_Type",          ddltype.SelectedValue),
             new SqlParameter("@FromDate",           txtFromDate.Text.Trim()),
             new SqlParameter("@ToDate",             txtToDate.Text.Trim())
         };
         ObjGenerateInternalBill.BindDataGrid(gvChallanDetail, "uspGenerateInternalBill", true, sqlParamS, lblRowCount);
         if (gvChallanDetail.Rows.Count > 0)
         {
             imgBtnConfirm.Visible = true;
             ImgBtnCancel.Visible  = true;
         }
         else
         {
             imgBtnConfirm.Visible = false;
             ImgBtnCancel.Visible  = false;
         }
     }
     catch (Exception ex)
     {
         SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
     }
 }
Exemple #24
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());
     }
 }
Exemple #25
0
    protected void InsertUpdateMISComplaint()
    {
        //Save data to MISComplaint Table
        try
        {
            objspareconsumeforcomplaint.Complaint_No = lblComplaintNo.Text;
            objspareconsumeforcomplaint.CreatedBy    = Membership.GetUser().UserName.ToString();
            if (hdnProposedSpares.Value == "")
            {
                objspareconsumeforcomplaint.WaitingForSpare = 0;
            }
            else
            {
                objspareconsumeforcomplaint.WaitingForSpare = 1;
            }
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), " Going to InsertUpdateMISComplaint For Complaint: " + lblComplaintNo.Text);

            objspareconsumeforcomplaint.InsertUpdateMISComplaint();
        }
        catch (Exception ex)
        {
            //lblMessage.Text = ex.Message;
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + " For Complaint: " + lblComplaintNo.Text + " --> " + ex.Message.ToString());
        }
    }
Exemple #26
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 Page_Load(object sender, EventArgs e)
    {
        objCommonClass.SelectASC_Name_Code(Membership.GetUser().UserName.ToString());
        hdnASC_Code.Value    = Convert.ToString(objCommonClass.ASC_Id);
        objSalesOrder.ASC_Id = hdnASC_Code.Value;

        if (!Page.IsPostBack)
        {
            try
            {
                ViewState["Column"] = "Spare_Receipt_Id";
                ViewState["Order"]  = "ASC";
                lblRowCount.Visible = false;
                if (!string.IsNullOrEmpty(Request.QueryString["PONumber"]))
                {
                    BindData();
                }
            }
            catch (Exception ex)
            {
                SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
                //Response.Redirect("../../Pages/Default.aspx");
            }
        }
        System.Threading.Thread.Sleep(Convert.ToInt32(ConfigurationManager.AppSettings["AjaxPleaseWaitTime"]));
    }
    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();
    }
    // The below will check record and takes first paramenter as Stored Proc or Sql Query
    // second argument as whether this is proc or query i.e. true for stored proc and flase for sql query
    // third parameter is passed sql parameters array
    public bool IsExists(string strProcOrQuery, bool isProc, SqlParameter sqlParam)
    {
        try
        {
            strCommon = "";
            if (isProc)
            {
                sqlDr = objSql.ExecuteReader(CommandType.StoredProcedure, strProcOrQuery, sqlParam);
            }
            else
            {
                sqlDr = objSql.ExecuteReader(CommandType.Text, strProcOrQuery, sqlParam);
            }

            if (sqlDr.Read())
            {
                return(true);
            }
            return(false);
        }
        catch (Exception ex)
        {
            SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
            return(false);
        }
    }
 protected void BindGridView()
 {
     try
     {
         double         Amount    = 0;
         SqlParameter[] sqlParamS =
         {
             new SqlParameter("@IBN",  lbltransactionno.Text),
             new SqlParameter("@Type", "GET_DATA")
         };
         objcommon.BindDataGrid(gvChallanDetail, "uspPrintInternalBill", true, sqlParamS, lblRowCount);
         foreach (GridViewRow item in gvChallanDetail.Rows)
         {
             Amount = Amount + Convert.ToDouble(item.Cells[10].Text);
         }
         lbltotalamount.Text = Amount.ToString();
         if (lblRowCount.Text.Trim() == "" || lblRowCount.Text.Trim() == "0")
         {
             ScriptManager.RegisterClientScriptBlock(imgBtnClose, GetType(), "Alert", "alert('Invalid IBN No');window.close();", true);
         }
     }
     catch (Exception ex)
     {
         SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString());
     }
 }