示例#1
0
    public static string[] GetCompletionList(string prefixText, int count, string contextKey)
    {
        DMRequisitionCancellation Obj_RequisitionCafeteria = new DMRequisitionCancellation();

        String[] SearchList = Obj_RequisitionCafeteria.GetSuggestedRecord(prefixText);
        return(SearchList);
    }
示例#2
0
    private void ReportGridItem()
    {
        try
        {
            DataSet DsGrd = new DataSet();
            StrCondition = string.Empty;
            int ReqId = Convert.ToInt32(ddlReqNo.SelectedValue.ToString());
            DsGrd = obj_DMReqCancellation.GetRecordForItem("I", ReqId, out StrError);

            if (DsGrd.Tables.Count > 0 && DsGrd.Tables[0].Rows.Count > 0)
            {
                GridDtlsItem.DataSource = DsGrd.Tables[0];
                GridDtlsItem.DataBind();
                GridDtlsItem.Visible = true;
            }
            else
            {
                GridDtlsItem.DataSource = null;
                GridDtlsItem.DataBind();
            }
            obj_DMReqCancellation = null;
            DsGrd = null;
        }
        catch (Exception ex) { throw new Exception(ex.Message); }
    }
示例#3
0
 private void FillCombo()
 {
     try
     {
         DataSet DSRequisition = new DataSet();
         string  cond          = string.Empty;
         //if (Convert.ToBoolean(Session["IsCentral"].ToString()))
         //{
         //    cond = string.Empty;
         //}
         //else
         //{
         //    cond = " and RC.CafeteriaId="+Convert.ToInt32(Session["CafeteriaId"].ToString());
         //}
         DSRequisition = obj_DMReqCancellation.FillCombo(cond, out StrError);
         if (DSRequisition.Tables.Count > 0)
         {
             if (DSRequisition.Tables[0].Rows.Count > 0)
             {
                 ddlReqNo.DataSource     = DSRequisition.Tables[0];
                 ddlReqNo.DataTextField  = "RequisitionNo";
                 ddlReqNo.DataValueField = "RequisitionCafeId";
                 ddlReqNo.DataBind();
                 ddlReqNo.Focus();
             }
         }
         else
         {
             DSRequisition         = null;
             obj_DMReqCancellation = null;
         }
     }
     catch (Exception ex) { throw new Exception(ex.Message); }
 }
示例#4
0
    private void ReportToGrid()
    {
        try
        {
            DataSet DsGrd = new DataSet();
            StrCondition = string.Empty;

            if (ChkFrmDate.Checked == true)
            {
                StrCondition = StrCondition + " AND (RequisitionDate between '" + Convert.ToDateTime(txtFromDate.Text).ToString("MM-dd-yyyy") + "' AND '" + Convert.ToDateTime(txtToDate.Text).ToString("MM-dd-yyyy") + "' )";
            }
            else
            {
                StrCondition = StrCondition + " AND (RequisitionDate between '01-01-1975' AND '" + DateTime.Now.ToString("MM-dd-yyyy") + "' )";
            }

            //if (!Convert.ToBoolean(Session["IsCentral"].ToString()))
            //{
            //    //StrCondition = StrCondition + " AND RCF.CafeteriaId=" + Convert.ToInt32(Session["CafeteriaId"].ToString());
            //}
            DsGrd = obj_DMReqCancellation.GetRecordForRequisition("R", StrCondition, out StrError);

            if (DsGrd.Tables.Count > 0 && DsGrd.Tables[0].Rows.Count > 0)
            {
                GridDetails.DataSource = DsGrd.Tables[0];
                GridDetails.DataBind();
                GridDetails.Visible = true;
            }
            else
            {
                GridDetails.DataSource = null;
                GridDetails.DataBind();
            }
            obj_DMReqCancellation = null;
            DsGrd = null;
        }
        catch (Exception ex) { throw new Exception(ex.Message); }
    }
示例#5
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        int InsertRow = 0, UpdateIsDelivr = 0, InsertRowDtls = 0;

        try
        {
            //--------**Save Record RequisitionWise**-----------
            if (RdoType.SelectedValue == "R")
            {
                Entity_ReqCancellation.RequisitionCancelId = Convert.ToInt32(ViewState["ID"]);
                Entity_ReqCancellation.CancelledBy         = lblEmployee.Text;
                Entity_ReqCancellation.CancelledDate       = (!string.IsNullOrEmpty(TxtCancelDate.Text)) ? Convert.ToDateTime(TxtCancelDate.Text) : Convert.ToDateTime("01/01/1753");
                Entity_ReqCancellation.Reason = TxtCancelReason.Text;


                Entity_ReqCancellation.UserId    = Convert.ToInt32(Session["UserId"]);
                Entity_ReqCancellation.LoginDate = DateTime.Now;
                //--**Update Cancel Flag in RequisitionCageteria**--
                for (int i = 0; i < GridDetails.Rows.Count; i++)
                {
                    Label    LblEntryId    = (Label)GridDetails.Rows[i].Cells[i].FindControl("LblEntryId");
                    CheckBox GrdSelectAll1 = (CheckBox)GridDetails.Rows[i].Cells[i].FindControl("GrdSelectAll1");

                    Entity_ReqCancellation.RequisitionCafeId = Convert.ToInt32(LblEntryId.Text);
                    Entity_ReqCancellation.IsCancel          = GrdSelectAll1.Checked.Equals(false) ? 0 : 1;

                    InsertRow = obj_DMReqCancellation.UpdateRequisitionWise(ref Entity_ReqCancellation, out StrError);
                }
                if (InsertRow > 0)
                {
                    if (InsertRow > 0)
                    {
                        obj_Comman.ShowPopUpMsg("Record Saved Successfully", this.Page);
                        MakeEmptyForm();
                        Entity_ReqCancellation = null;
                        obj_DMReqCancellation  = null;
                    }
                }
            }
            //--------**Save Record ItemWise**-----------
            else
            {
                int CountChecked = 0;
                int CancelID     = Convert.ToInt32(ViewState["ID"]);
                Entity_ReqCancellation.RequisitionCancelId = Convert.ToInt32(ViewState["ID"]);
                Entity_ReqCancellation.RequisitionCafeId   = Convert.ToInt32(ddlReqNo.SelectedValue);
                Entity_ReqCancellation.CancelledBy         = lblEmployee.Text;
                Entity_ReqCancellation.CancelledDate       = (!string.IsNullOrEmpty(TxtCancelDate.Text)) ? Convert.ToDateTime(TxtCancelDate.Text) : Convert.ToDateTime("01/01/1753");
                Entity_ReqCancellation.Reason = TxtCancelReason.Text;


                Entity_ReqCancellation.UserId    = Convert.ToInt32(Session["UserId"]);
                Entity_ReqCancellation.LoginDate = DateTime.Now;

                InsertRow = obj_DMReqCancellation.UpdateRequisitionItemWise(ref Entity_ReqCancellation, out StrError);

                //--**Update Cancel Flag in RequisitionCafeDetails**--
                for (int i = 0; i < GridDtlsItem.Rows.Count; i++)
                {
                    Label LblEntryId = (Label)GridDtlsItem.Rows[i].Cells[1].FindControl("LblEntryId");
                    Entity_ReqCancellation.RequisitionCancelId = Convert.ToInt32(CancelID);
                    Entity_ReqCancellation.RequisitionCafeId   = Convert.ToInt32(LblEntryId.Text);
                    Entity_ReqCancellation.OrdQty = Convert.ToDecimal(GridDtlsItem.Rows[i].Cells[7].Text.ToString());
                    Entity_ReqCancellation.ItemId = Convert.ToInt32(GridDtlsItem.Rows[i].Cells[10].Text.ToString());

                    if (((CheckBox)GridDtlsItem.Rows[i].Cells[i].FindControl("GrdSelectAll2")).Checked == true)
                    {
                        InsertRow = obj_DMReqCancellation.InsertReqCancelDtls(ref Entity_ReqCancellation, out StrError);
                    }
                    else
                    {
                        CountChecked = CountChecked + 1;
                    }
                }
                if (CountChecked == GridDtlsItem.Rows.Count)
                {
                }
                if (InsertRow > 0)
                {
                    if (InsertRow > 0)
                    {
                        obj_Comman.ShowPopUpMsg("Record Saved Successfully", this.Page);
                        MakeEmptyForm();
                        Entity_ReqCancellation = null;
                        obj_DMReqCancellation  = null;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }