Esempio n. 1
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        int UpdateRow = 0;

        for (int j = 0; j < GrdReq.Rows.Count; j++)
        {
            if ((GrdReq.Rows[j].Cells[8].Text) == "Approved")
            {
                string STR = ((Label)GrdReq.Rows[j].FindControl("LblEntryId")).Text;
                Entity_ApproveRequisition.RequisitionCafeId = Convert.ToInt32(((Label)GrdReq.Rows[j].FindControl("LblEntryId")).Text);
                Entity_ApproveRequisition.ReqStatus         = GrdReq.Rows[j].Cells[8].Text.ToString();
                Entity_ApproveRequisition.ApprovedTime      = DateTime.Now;
                Entity_ApproveRequisition.UserId            = Convert.ToInt32(Session["UserID"]);
                Entity_ApproveRequisition.LoginDate         = DateTime.Now;
                UpdateRow = Obj_ApproveRequisition.UpdateReq_Status_Approve(ref Entity_ApproveRequisition, out StrError);
                ((ImageButton)GrdReq.Rows[j].FindControl("ImageCancel")).Visible     = false;
                ((ImageButton)GrdReq.Rows[j].FindControl("ImageAuthorised")).Visible = true;
            }
            if ((GrdReq.Rows[j].Cells[8].Text) == "Authorised")
            {
                Entity_ApproveRequisition.RequisitionCafeId = Convert.ToInt32(((Label)GrdReq.Rows[j].FindControl("LblEntryId")).Text);
                Entity_ApproveRequisition.ReqStatus         = GrdReq.Rows[j].Cells[8].Text.ToString();
                Entity_ApproveRequisition.AuthorizedTime    = DateTime.Now;
                Entity_ApproveRequisition.UserId            = Convert.ToInt32(Session["UserID"]);
                Entity_ApproveRequisition.LoginDate         = DateTime.Now;
                UpdateRow = Obj_ApproveRequisition.UpdateReq_Status_Authorozed(ref Entity_ApproveRequisition, out StrError);
                ((ImageButton)GrdReq.Rows[j].FindControl("ImageSuccess")).Visible    = true;
                ((ImageButton)GrdReq.Rows[j].FindControl("ImageAuthorised")).Visible = false;
                ((ImageButton)GrdReq.Rows[j].FindControl("ImageCancel")).Visible     = false;
                //SendMail(Convert.ToInt32(((Label)GrdReq.Rows[j].FindControl("LblEntryId")).Text));
            }
        }
        BindReportGrid("");
        GETHIGHLITE();
        ScriptManager.RegisterStartupScript(this, GetType(), "ShowPOP", "javascript:HidePOP();", true);
    }
Esempio n. 2
0
    private void GetConfirm()
    {
        string   RequestFor  = string.Empty;
        string   RequestBY   = string.Empty;
        string   StrError    = string.Empty;
        int      RequestID   = 0;
        DateTime RequestDate = DateTime.Now;
        int      LoginID     = 0;
        DateTime LoginDate   = DateTime.Now;

        RequestFor = Convert.ToString(Request.QueryString["for"].ToString());
        RequestID  = Convert.ToInt32(Request.QueryString["request"].ToString());
        RequestBY  = Convert.ToString(Request.QueryString["by"].ToString());

        DMUserLogin obj_Login = new DMUserLogin();
        DataSet     dsLogin   = obj_Login.GetLoginIDFORMAILREQUEST(RequestBY, out StrError);

        if (dsLogin.Tables.Count > 0 && dsLogin.Tables[0].Rows.Count > 0)
        {
            LoginID = Convert.ToInt32(dsLogin.Tables[0].Rows[0]["UserId"].ToString());
            if (RequestFor == "Req")
            {
                DMApproveRequisition Obj_ApproveRequisition    = new DMApproveRequisition();
                ApproveRequisition   Entity_ApproveRequisition = new ApproveRequisition();
                Entity_ApproveRequisition.RequisitionCafeId = Convert.ToInt32(RequestID);
                Entity_ApproveRequisition.ReqStatus         = "Authorised";
                Entity_ApproveRequisition.AuthorizedTime    = DateTime.Now;
                Entity_ApproveRequisition.UserId            = LoginID;
                Entity_ApproveRequisition.LoginDate         = DateTime.Now;
                int UpdateRow = Obj_ApproveRequisition.UpdateReq_Status_Authorozed(ref Entity_ApproveRequisition, out StrError);
                if (UpdateRow > 0)
                {
                    SendMailREQ(RequestID);
                    LblPass.Text = "Requisition Has Been Successfully Authorized..";
                }
                else
                {
                    LblPass.Text = "Requisition Not Authorize Please Try After Some Time..";
                }
            }
            else
            {
                DMEditPurchaseOrder Obj_EditPO           = new DMEditPurchaseOrder();
                EditPurchaseOrder   Entity_PurchaseOrder = new EditPurchaseOrder();
                Entity_PurchaseOrder.POId           = Convert.ToInt32(RequestID);
                Entity_PurchaseOrder.POStatus       = "Authorised";
                Entity_PurchaseOrder.AuthorizedTime = DateTime.Now;
                Entity_PurchaseOrder.UserId         = LoginID;
                Entity_PurchaseOrder.LoginDate      = DateTime.Now;
                int UpdateRow = Obj_EditPO.UpdatePurchase_OrderStatus_Authroized(ref Entity_PurchaseOrder, out StrError);
                if (UpdateRow > 0)
                {
                    SendMail(RequestID);
                    LblPass.Text = "Purchase Order Has Been Successfully Authorized..";
                }
                else
                {
                    LblPass.Text = "Purchase Order Not Authorize Please Try After Some Time..";
                }
            }
        }
    }