예제 #1
0
    protected void ReportGrid_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        int DeleteId = 0;

        try
        {
            DeleteId = Convert.ToInt32(((ImageButton)ReportGridDeviation.Rows[e.RowIndex].Cells[0].FindControl("ImgBtnDelete")).CommandArgument.ToString());
            if (DeleteId != 0)
            {
                Entity_Deviation.DeviationID = DeleteId;
                Entity_Deviation.LoginID     = Convert.ToInt32(Session["UserID"]);
                Entity_Deviation.LoginDate   = DateTime.Now;
                int iDelete = Obj_Deviation.Delete_DeviationMaster(ref Entity_Deviation, out StrError);
                if (iDelete != 0)
                {
                    obj_Comman.ShowPopUpMsg("Record Deleted Successfully..!", this.Page);
                    MakeEmptyForm();
                }
            }
            Entity_Deviation = null;
            Obj_Deviation    = null;
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
예제 #2
0
    public static string[] GetCompletionList(string prefixText, int count, string contextKey)
    {
        DMDeviation Obj_DMDeviation = new DMDeviation();

        String[] SearchList = Obj_DMDeviation.GetSuggestedRecord(prefixText);
        return(SearchList);
    }
예제 #3
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        int InsertRow = 0, InsertRowDtls = 0;

        try
        {
            Entity_Deviation.DeviationNo   = "";
            Entity_Deviation.LoginID       = Convert.ToInt32(Session["UserId"]);
            Entity_Deviation.LoginDate     = Convert.ToDateTime(DateTime.Now.ToShortDateString());
            Entity_Deviation.DeviationFrom = Convert.ToDateTime(txtFromDate.Text);
            Entity_Deviation.DeviationTo   = Convert.ToDateTime(txtToDate.Text);

            Entity_Deviation.SysAmt = Convert.ToDecimal(TxtSysamount.Text);
            Entity_Deviation.PhyAmt = Convert.ToDecimal(TxtPhyamount.Text);

            InsertRow = Obj_Deviation.Insert_DeviationMaster(ref Entity_Deviation, Convert.ToInt32(Session["CafeteriaId"].ToString()), out StrError);
            if (InsertRow > 0)
            {
                if (DeviationGrid.Rows.Count > 0)
                {
                    DataTable dtInsert = new DataTable();
                    for (int i = 0; i < DeviationGrid.Rows.Count; i++)
                    {
                        Entity_Deviation.DeviationID = InsertRow;
                        Entity_Deviation.ItemID      = Convert.ToInt32(((Label)DeviationGrid.Rows[i].FindControl("LblProcessId")).Text);
                        Entity_Deviation.UnitID      = Convert.ToInt32(DeviationGrid.Rows[i].Cells[5].Text);
                        Entity_Deviation.Rate        = Convert.ToDecimal(DeviationGrid.Rows[i].Cells[7].Text);
                        Entity_Deviation.LocationID  = Convert.ToInt32(DeviationGrid.Rows[i].Cells[8].Text);
                        Entity_Deviation.SysClosing  = Convert.ToDecimal(((TextBox)DeviationGrid.Rows[i].FindControl("GrtxtSysClosing")).Text);
                        Entity_Deviation.PhyClosing  = Convert.ToDecimal(((TextBox)DeviationGrid.Rows[i].FindControl("GrtxtPhyClosing")).Text);
                        Entity_Deviation.Deviation1  = (Convert.ToDecimal(((TextBox)DeviationGrid.Rows[i].FindControl("GrtxtSysClosing")).Text) - Convert.ToDecimal(((TextBox)DeviationGrid.Rows[i].FindControl("GrtxtPhyClosing")).Text));           //Convert.ToDecimal(((Label)DeviationGrid.Rows[i].FindControl("Deviation")).Text);
                        Entity_Deviation.PhyRate     = Convert.ToDecimal(((TextBox)DeviationGrid.Rows[i].FindControl("GrtxtPhyRate")).Text);
                        InsertRowDtls = Obj_Deviation.Insert_DeviationDetails(ref Entity_Deviation, out StrError);
                    }
                }
            }

            if (InsertRow > 0)
            {
                obj_Comman.ShowPopUpMsg("Record Saved Successfully", this.Page);
                MakeEmptyForm();
                Entity_Deviation = null;
                Obj_Deviation    = null;
            }
        }
        catch (Exception ex) { throw new Exception(ex.Message); }
    }
예제 #4
0
    protected void ReportGrid_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            switch (e.CommandName)
            {
            case ("Select"):
            {
                if (Convert.ToInt32(e.CommandArgument) != 0)
                {
                    ViewState["ID"] = Convert.ToInt32(e.CommandArgument);
                    Ds = Obj_Deviation.GetRecordForEdit(Convert.ToInt32(e.CommandArgument), out StrError);

                    if (Ds.Tables[0].Rows.Count > 0)
                    {
                        DeviationGrid.DataSource = Ds.Tables[0];
                        DeviationGrid.DataBind();
                        ViewState["CurrentTable"] = Ds.Tables[0];
                        BtnUpdate.Visible         = true;
                        BtnSave.Visible           = false;
                        BtnShow.Visible           = false;
                        lblDevationPeriod.Text    = "Deviation Period - " + Ds.Tables[0].Rows[0]["DevationPeriod"].ToString();
                        MakeControlDisable(1);
                        DeviationGrid.Columns[13].Visible = false;
                        DeviationGrid.Columns[14].Visible = false;
                        (TxtSysamount.Text)          = Ds.Tables[0].Rows[0]["SysAmt"].ToString();
                        (TxtPhyamount.Text)          = Ds.Tables[0].Rows[0]["PhyAmt"].ToString();
                        (TxtTotDeviationAmount.Text) = (Convert.ToDecimal((TxtSysamount.Text)) - Convert.ToDecimal((TxtPhyamount.Text))).ToString("#0.00");
                        // GetAmount();
                        ScriptManager.RegisterStartupScript(this, GetType(), "TotalForUpdates", "javascript:TotalForUpdates();", true);
                    }
                    else
                    {
                        MakeEmptyForm();
                    }

                    Ds            = null;
                    Obj_Deviation = null;
                }
                break;
            }
            }
        }
        catch (Exception ex) { throw new Exception(ex.Message); }
    }