Esempio n. 1
0
    private void MakeEmptyForm()
    {
        ChkFrmDate.Checked = true;
        Fillchkdate();
        txtFromDate.Text = DateTime.Now.ToString("dd-MMM-yyyy");
        txtToDate.Text   = DateTime.Now.ToString("dd-MMM-yyyy");
        SetInitialRow();
        StrCondition = string.Empty;
        BindReportGrid(StrCondition);
        ddlLocation.SelectedIndex = 0;
        ddlCategory.SelectedIndex = 0;
        ddlItemName.SelectedIndex = 0;
        ddlUnit.SelectedIndex     = 0;

        RDO_FromTo.Checked             = false;
        RDO_GreaterThenEqualTo.Checked = false;
        RDO_LessThenEqualTo.Checked    = false;
        RDO_EqualTo.Checked            = false;

        TxtSysamount.Text   = TxtPhyamount.Text = TxtTotDeviationAmount.Text = txtFromRate.Text = "";
        txtToRate.Text      = "";
        txtGreaterRate.Text = "";
        txtLessRate.Text    = "";
        txtEqualRate.Text   = "";
        TxtSearch.Text      = string.Empty;
        if (!FlagAdd)
        {
            BtnSave.Visible = true;
        }
        BtnUpdate.Visible = false;
        BtnShow.Visible   = true;
        MakeControlDisable(0);
        #region [UserRights]
        if (FlagEdit)
        {
            foreach (GridViewRow GRow in ReportGridDeviation.Rows)
            {
                GRow.FindControl("ImageGridEdit").Visible = false;
            }
        }
        if (FlagDel)
        {
            foreach (GridViewRow GRow in ReportGridDeviation.Rows)
            {
                GRow.FindControl("ImgBtnDelete").Visible = false;
            }
        }
        if (FlagPrint)
        {
            foreach (GridViewRow GRow in ReportGridDeviation.Rows)
            {
                GRow.FindControl("ImgBtnPrint").Visible = false;
            }
        }
        #endregion
    }
Esempio n. 2
0
    //User Right Function===========

    private void MakeEmptyForm()
    {
        if (!FlagAdd)
        {
            BtnSave.Visible = true;
        }
        BtnUpdate.Visible           = false;
        ddlInwardNo.Enabled         = true;
        FlagForCalculationOperation = false;
        CalendarExtender2.EndDate   = CalendarExtender1.EndDate = DateTime.Now;
        Fillcombo();
        lblPreparedBy.Text        = Session["UserName"].ToString();
        lblReturndate.Text        = System.DateTime.Now.ToString("dd-MMM-yyyy");
        ddlInwardNo.SelectedValue = "0";
        lblInwardNo.Text          = "";
        lblInwardDate.Text        = "";
        lblSuppName.Text          = "";
        lblQuotationDate.Text     = "";
        lblQuotationNo.Text       = "";
        lblpono.Text             = "";
        lblPODATE.Text           = "";
        TxtSearch.Text           = "";
        ViewState["EditId"]      = null;
        ViewState["DamagedDtls"] = null;
        SetInitialRow();
        BindReportGrid(StrCondition);
        chkReturnDebitNote.Checked = false;
        #region [UserRights]
        if (FlagEdit)
        {
            foreach (GridViewRow GRow in ReportGridDtls.Rows)
            {
                GRow.FindControl("ImageGridEdit").Visible = false;
            }
        }
        if (FlagDel)
        {
            foreach (GridViewRow GRow in ReportGridDtls.Rows)
            {
                GRow.FindControl("ImgBtnDelete").Visible = false;
            }
        }
        if (FlagPrint)
        {
            foreach (GridViewRow GRow in ReportGridDtls.Rows)
            {
                GRow.FindControl("ImgBtnPrint").Visible = false;
            }
        }
        #endregion
        ddlInwardNo.Focus();
    }
Esempio n. 3
0
 protected void ReportGridDtls_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     try
     {
         this.ReportGridDtls.PageIndex = e.NewPageIndex;
         DataSet DS = new DataSet();
         StrCondition = string.Empty;
         string COND = string.Empty;
         if (!Convert.ToBoolean(Session["IsCentral"].ToString()))
         {
             COND = COND + " AND RM.Location=" + Convert.ToInt32(Session["CafeteriaId"].ToString());
         }
         DS = Obj_damage.GetReturnDetails(StrCondition, COND, out StrError);
         if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
         {
             ReportGridDtls.DataSource = DS.Tables[0];
             this.ReportGridDtls.DataBind();
             //-----UserRights------
             if (FlagDel && FlagEdit)
             {
                 foreach (GridViewRow GRow in ReportGridDtls.Rows)
                 {
                     GRow.FindControl("ImgBtnDelete").Visible  = false;
                     GRow.FindControl("ImageGridEdit").Visible = false;
                 }
             }
             else if (FlagDel)
             {
                 foreach (GridViewRow GRow in ReportGridDtls.Rows)
                 {
                     GRow.FindControl("ImgBtnDelete").Visible = false;
                 }
             }
             else
             {
                 foreach (GridViewRow GRow in ReportGridDtls.Rows)
                 {
                     GRow.FindControl("ImageGridEdit").Visible = false;
                 }
             }
         }
         else
         {
             //SetInitialRow_ReportGrid();
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Esempio n. 4
0
 protected void ReportGrid_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     try
     {
         this.ReportGrid.PageIndex = e.NewPageIndex;
         Ds = new DataSet();
         Ds = OBJ_IndentEmail.FillCombo(Convert.ToInt32(Session["TransactionSiteID"].ToString()), out StrError);
         if (Ds.Tables.Count > 0)
         {
             if (Ds.Tables[0].Rows.Count > 0)
             {
                 ReportGrid.DataSource = Ds.Tables[0];
                 this.ReportGrid.DataBind();
                 //-----For UserRights------
                 if (FlagDel && FlagEdit)
                 {
                     foreach (GridViewRow GRow in ReportGrid.Rows)
                     {
                         GRow.FindControl("ImgBtnDelete").Visible  = false;
                         GRow.FindControl("ImageGridEdit").Visible = false;
                     }
                 }
                 else if (FlagDel)
                 {
                     foreach (GridViewRow GRow in ReportGrid.Rows)
                     {
                         GRow.FindControl("ImgBtnDelete").Visible = false;
                     }
                 }
                 else if (FlagEdit)
                 {
                     foreach (GridViewRow GRow in ReportGrid.Rows)
                     {
                         GRow.FindControl("ImageGridEdit").Visible = false;
                     }
                 }
             }
             Ds = null;
         }
         else
         {
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Esempio n. 5
0
    //User Right Function===========

    private void MakeEmptyForm()
    {
        if (!FlagAdd)
        {
            BtnSave.Visible = true;
        }
        BtnUpdate.Visible = false;

        TxtCancelDate.Text = string.Empty;
        //lblEmployee.Text = string.Empty;
        TxtCancelReason.Text = string.Empty;
        lblCafeteria.Text    = string.Empty;

        RdoType.SelectedValue = "R";
        TxtSearch.Text        = string.Empty;
        ChkFrmDate.Checked    = true;
        txtFromDate.Text      = DateTime.Now.AddMonths(-1).ToString("dd-MMM-yyyy");
        txtToDate.Text        = DateTime.Now.ToString("dd-MMM-yyyy");
        TxtCancelDate.Text    = DateTime.Now.ToString("dd-MMM-yyyy");
        SetInitialRow();
        SetInitialRow_GridItem();
        GetBindReqDtls(StrCondition);

        #region [UserRights]
        if (FlagEdit)
        {
            foreach (GridViewRow GRow in ReportGrid.Rows)
            {
                GRow.FindControl("ImageGridEdit").Visible = false;
            }
        }
        if (FlagDel)
        {
            foreach (GridViewRow GRow in ReportGrid.Rows)
            {
                GRow.FindControl("ImgBtnDelete").Visible = false;
            }
        }
        if (FlagPrint)
        {
            foreach (GridViewRow GRow in ReportGrid.Rows)
            {
                GRow.FindControl("ImgBtnPrint").Visible = false;
            }
        }
        #endregion
    }
Esempio n. 6
0
 protected void GrdReport_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     try
     {
         this.GrdReport.PageIndex = e.NewPageIndex;
         DataSet DS = new DataSet();
         StrCondition = string.Empty;
         DS           = Obj_IssueRegister.GetIssueRegister(StrCondition, out StrError);
         if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
         {
             GrdReport.DataSource = DS.Tables[0];
             this.GrdReport.DataBind();
             //-----For UserRights-------
             if (FlagDel && FlagEdit)
             {
                 foreach (GridViewRow GRow in GrdReport.Rows)
                 {
                     GRow.FindControl("ImageBtnDelete").Visible = false;
                     GRow.FindControl("ImgGridEdit").Visible    = false;
                 }
             }
             else if (FlagDel)
             {
                 foreach (GridViewRow GRow in GrdReport.Rows)
                 {
                     GRow.FindControl("ImageBtnDelete").Visible = false;
                 }
             }
             else
             {
                 foreach (GridViewRow GRow in GrdReport.Rows)
                 {
                     GRow.FindControl("ImgGridEdit").Visible = false;
                 }
             }
         }
         else
         {
             //SetInitialRow_ReportGrid();
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Esempio n. 7
0
    //User Right Function===========

    public void MakeEmptyForm()
    {
        ViewState["EditID"] = null;
        if (!FlagAdd)
        {
            BtnSave.Visible = true;
        }
        BtnUpdate.Visible = false;
        TxtMIssueNo.Focus();
        TxtReqBy.Text     = TxtReqstnDate.Text = TxtSearch.Text = string.Empty;
        ddlIssueTo.Text   = Session["UserName"].ToString().ToUpper();
        TxtIssueDate.Text = System.DateTime.Now.ToString("dd-MMM-yyyy");
        // TxtReqstnDate.Text = System.DateTime.Now.ToString("dd-MMM-yyyy");
        //  ddlIssueTo.SelectedValue = "0";
        ddlRequisitionNo.SelectedValue = "0";
        ddlCategory.SelectedIndex      = ddlItems.SelectedIndex = 0;
        GetIssueRegisterNO();
        SetInitialRow();
        SetInitialRow_IssueDetails();
        ddlRequisitionNo.Enabled = true;
        ReportGrid(StrCondition);
        #region [UserRights]
        if (FlagEdit)
        {
            foreach (GridViewRow GRow in GrdReport.Rows)
            {
                GRow.FindControl("ImgGridEdit").Visible = false;
            }
        }
        if (FlagDel)
        {
            foreach (GridViewRow GRow in GrdReport.Rows)
            {
                GRow.FindControl("ImageBtnDelete").Visible = false;
            }
        }
        if (FlagPrint)
        {
            foreach (GridViewRow GRow in GrdReport.Rows)
            {
                GRow.FindControl("ImgBtnPrint").Visible = false;
            }
        }
        #endregion
    }
Esempio n. 8
0
 protected void ReportGrid_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     try
     {
         this.ReportGrid.PageIndex = e.NewPageIndex;
         Ds = new DataSet();
         Ds = obj_DMReqCancellation.GetRequisitionCancelationList("", out StrError);
         if (Ds.Tables.Count > 0 && Ds.Tables[0].Rows.Count > 0)
         {
             ReportGrid.DataSource = Ds.Tables[0];
             this.ReportGrid.DataBind();
             //-----For UserRights------
             if (FlagDel && FlagEdit)
             {
                 foreach (GridViewRow GRow in ReportGrid.Rows)
                 {
                     GRow.FindControl("ImgBtnDelete").Visible  = false;
                     GRow.FindControl("ImageGridEdit").Visible = false;
                 }
             }
             else if (FlagDel)
             {
                 foreach (GridViewRow GRow in ReportGrid.Rows)
                 {
                     GRow.FindControl("ImgBtnDelete").Visible = false;
                 }
             }
             else
             {
                 foreach (GridViewRow GRow in ReportGrid.Rows)
                 {
                     GRow.FindControl("ImageGridEdit").Visible = false;
                 }
             }
         }
         else
         {
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
    //User Right Function===========

    public void MakeEmptyForm()
    {
        ViewState["EditId"] = null;
        if (!FlagAdd)
        {
            BtnSave.Visible = true;
        }
        BtnUpdate.Visible = false;
        EnableControl(true);
        FillCombo();
        TxtConsumptionNo.Text = string.Empty;
        TxtDate.Text          = DateTime.Now.ToString("dd-MMM-yyyy");
        TxtFromDateR.Text     = DateTime.Now.AddMonths(-1).ToString("dd-MMM-yyyy");
        TxtToDateR.Text       = DateTime.Now.ToString("dd-MMM-yyyy");
        SetInitialRow();
        GetConsumeNo();
        BindReportGrid(StrCond);
        TRGRIDINWARD.Visible = true;
        #region [UserRights]
        if (FlagEdit)
        {
            foreach (GridViewRow GRow in ReportGrid1.Rows)
            {
                GRow.FindControl("ImageGridEdit").Visible = false;
            }
        }
        if (FlagDel)
        {
            foreach (GridViewRow GRow in ReportGrid1.Rows)
            {
                GRow.FindControl("ImgBtnDelete").Visible = false;
            }
        }
        if (FlagPrint)
        {
            foreach (GridViewRow GRow in ReportGrid1.Rows)
            {
                GRow.FindControl("ImgBtnPrint").Visible = false;
            }
        }
        #endregion
    }
Esempio n. 10
0
    //User Right Function===========

    public void MakeEmptyForm()
    {
        TxtDate.Text     = DateTime.Now.ToString("dd-MMM-yyyy");
        lblEmployee.Text = Session["UserName"].ToString().ToUpper();
        if (!FlagAdd)
        {
            BtnSave.Visible = true;
        }
        BtnUpdate.Visible = false;
        SetInitialRow();
        SetInitialRowReportGrid();
        FillCombo();
        ReportGrid(StrCondition);

        #region [UserRights]
        if (FlagEdit)
        {
            foreach (GridViewRow GRow in GridReport.Rows)
            {
                GRow.FindControl("ImageGridEdit").Visible = false;
            }
        }
        if (FlagDel)
        {
            foreach (GridViewRow GRow in GridReport.Rows)
            {
                GRow.FindControl("ImgBtnDelete").Visible = false;
            }
        }
        if (FlagPrint)
        {
            foreach (GridViewRow GRow in GridReport.Rows)
            {
                GRow.FindControl("ImgBtnPrint").Visible = false;
            }
        }
        #endregion
    }
Esempio n. 11
0
    //User Right Function===========
    public void CheckUserRight()
    {
        try
        {
            #region [USER RIGHT]
            //Checking Session Varialbels========
            if (Session["UserName"] != null && Session["UserRole"] != null)
            {
                //Checking User Role========
                //if (!Session["UserRole"].Equals("Administrator"))
                ////Checking Right of users=======
                //{
                System.Data.DataSet dsChkUserRight  = new System.Data.DataSet();
                System.Data.DataSet dsChkUserRight1 = new System.Data.DataSet();
                dsChkUserRight1 = (DataSet)Session["DataSet"];

                DataRow[] dtRow = dsChkUserRight1.Tables[1].Select("FormName ='Material Return Register'");
                if (dtRow.Length > 0)
                {
                    DataTable dt = dtRow.CopyToDataTable();
                    dsChkUserRight.Tables.Add(dt);    // = dt.Copy();
                }
                if (Convert.ToBoolean(dsChkUserRight.Tables[0].Rows[0]["ViewAuth"].ToString()) == false && Convert.ToBoolean(dsChkUserRight.Tables[0].Rows[0]["AddAuth"].ToString()) == false &&
                    Convert.ToBoolean(dsChkUserRight.Tables[0].Rows[0]["DelAuth"].ToString()) == false && Convert.ToBoolean(dsChkUserRight.Tables[0].Rows[0]["EditAuth"].ToString()) == false &&
                    Convert.ToBoolean(dsChkUserRight.Tables[0].Rows[0]["PrintAuth"].ToString()) == false)
                {
                    Response.Redirect("~/NotAuthUser.aspx");
                }
                //Checking View Right ========
                if (Convert.ToBoolean(dsChkUserRight.Tables[0].Rows[0]["ViewAuth"].ToString()) == false)
                {
                    ReportGridDtls.Visible = false;
                }
                //Checking Add Right ========
                if (Convert.ToBoolean(dsChkUserRight.Tables[0].Rows[0]["AddAuth"].ToString()) == false)
                {
                    BtnSave.Visible = false;
                    FlagAdd         = true;
                }
                //Edit /Delete Column Visible ========
                if (Convert.ToBoolean(dsChkUserRight.Tables[0].Rows[0]["DelAuth"].ToString()) == false && Convert.ToBoolean(dsChkUserRight.Tables[0].Rows[0]["EditAuth"].ToString()) == false &&
                    Convert.ToBoolean(dsChkUserRight.Tables[0].Rows[0]["PrintAuth"].ToString()) == false)
                {
                    foreach (GridViewRow GRow in ReportGridDtls.Rows)
                    {
                        GRow.FindControl("ImgBtnDelete").Visible  = false;
                        GRow.FindControl("ImageGridEdit").Visible = false;
                        GRow.FindControl("ImgBtnPrint").Visible   = false;
                    }
                    BtnUpdate.Visible = false;
                    FlagDel           = true;
                    FlagEdit          = true;
                    FlagPrint         = true;
                }
                else
                {
                    //Checking Delete Right ========
                    if (Convert.ToBoolean(dsChkUserRight.Tables[0].Rows[0]["DelAuth"].ToString()) == false)
                    {
                        foreach (GridViewRow GRow in ReportGridDtls.Rows)
                        {
                            GRow.FindControl("ImgBtnDelete").Visible = false;
                            FlagDel = true;
                        }
                    }

                    //Checking Edit Right ========
                    if (Convert.ToBoolean(dsChkUserRight.Tables[0].Rows[0]["EditAuth"].ToString()) == false)
                    {
                        foreach (GridViewRow GRow in ReportGridDtls.Rows)
                        {
                            GRow.FindControl("ImageGridEdit").Visible = false;
                            FlagEdit = true;
                        }
                    }

                    //Checking Print Right ========
                    if (Convert.ToBoolean(dsChkUserRight.Tables[0].Rows[0]["PrintAuth"].ToString()) == false)
                    {
                        foreach (GridViewRow GRow in ReportGridDtls.Rows)
                        {
                            GRow.FindControl("ImgBtnPrint").Visible = false;
                            FlagPrint = true;
                        }
                    }
                }
                dsChkUserRight.Dispose();
                //}
            }
            else
            {
                Response.Redirect("~/Default.aspx");
            }
            #endregion
        }
        catch (ThreadAbortException ex)
        {
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 12
0
 /// <summary>
 /// Adds a row
 /// </summary>
 /// <param name="row"></param>
 /// <returns>self</returns>
 public GTable AddRow(GRow row)
 {
     rows.Add(row); return this;
 }