Пример #1
0
    protected void ReportGridDtls_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        int DeleteId = 0;

        try
        {
            DeleteId = Convert.ToInt32(((ImageButton)ReportGridDtls.Rows[e.RowIndex].Cells[0].FindControl("ImgBtnDelete")).CommandArgument.ToString());
            if (DeleteId != 0)
            {
                Entity_damage.ReturnId  = DeleteId;
                Entity_damage.UserID    = Convert.ToInt32(Session["UserID"]);
                Entity_damage.LoginDate = DateTime.Now;

                int iDelete = Obj_damage.DeleteRecord(ref Entity_damage, out StrError);
                if (iDelete != 0)
                {
                    obj_Comm.ShowPopUpMsg("Record Deleted Successfully..!", this.Page);
                    MakeEmptyForm();
                }
            }
            Entity_damage = null;
            Obj_damage    = null;
        }
        catch (Exception ex) { throw new Exception(ex.Message); }
    }
Пример #2
0
        public int InsertRecord(ref EReturn Entity_damage, int LOCID, out string strError)
        {
            int iInsert = 0;

            strError = string.Empty;
            try
            {
                SqlParameter pAction      = new SqlParameter(EReturn._Action, SqlDbType.BigInt);
                SqlParameter pReturnDate  = new SqlParameter(EReturn._ReturnDate, SqlDbType.DateTime);
                SqlParameter pPreparedBy  = new SqlParameter(EReturn._PreparedBy, SqlDbType.BigInt);
                SqlParameter pInwardId    = new SqlParameter(EReturn._InwardId, SqlDbType.BigInt);
                SqlParameter pCreatedBy   = new SqlParameter(EReturn._UserId, SqlDbType.BigInt);
                SqlParameter pIsDebitNote = new SqlParameter(EReturn._IsDebitNote, SqlDbType.BigInt);
                SqlParameter pCreatedDate = new SqlParameter(EReturn._LoginDate, SqlDbType.DateTime);
                SqlParameter pLOCID       = new SqlParameter("@LOCID", SqlDbType.BigInt);

                pAction.Value      = 1;
                pReturnDate.Value  = Entity_damage.ReturnDate;
                pPreparedBy.Value  = Entity_damage.PreparedBy;
                pInwardId.Value    = Entity_damage.InwardId;
                pCreatedBy.Value   = Entity_damage.UserID;
                pCreatedDate.Value = Entity_damage.LoginDate;
                pLOCID.Value       = LOCID;
                pIsDebitNote.Value = Entity_damage.IsDebitNote;
                SqlParameter[] Param = new SqlParameter[] { pAction, pReturnDate, pPreparedBy, pInwardId, pCreatedBy, pCreatedDate, pLOCID, pIsDebitNote };

                Open(CONNECTION_STRING);
                BeginTransaction();

                iInsert = SQLHelper.ExecuteScalar(_Connection, _Transaction, CommandType.StoredProcedure, EReturn.SP_ReturnMaster, Param);

                if (iInsert > 0)
                {
                    CommitTransaction();
                }
                else
                {
                    RollBackTransaction();
                }
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                strError = ex.Message;
            }
            finally
            {
                Close();
            }
            return(iInsert);
        }
Пример #3
0
        public int DeleteRecord(ref EReturn Entity_damage, out string strError)
        {
            int iDelete = 0;

            strError = string.Empty;
            try
            {
                SqlParameter pAction   = new SqlParameter(EReturn._Action, SqlDbType.BigInt);
                SqlParameter pReturnId = new SqlParameter(EReturn._ReturnId, SqlDbType.BigInt);

                SqlParameter pDeletedBy   = new SqlParameter(EReturn._UserId, SqlDbType.BigInt);
                SqlParameter pDeletedDate = new SqlParameter(EReturn._LoginDate, SqlDbType.DateTime);


                pAction.Value   = 3;
                pReturnId.Value = Entity_damage.ReturnId;

                pDeletedBy.Value   = Entity_damage.UserID;
                pDeletedDate.Value = Entity_damage.LoginDate;
                //    pIsDeleted.Value = Entity_damage.IsDeleted;

                SqlParameter[] Param = new SqlParameter[] { pAction, pReturnId, pDeletedBy, pDeletedDate };

                Open(CONNECTION_STRING);
                BeginTransaction();

                iDelete = SQLHelper.ExecuteNonQuery(_Connection, _Transaction, CommandType.StoredProcedure, EReturn.SP_ReturnMaster, Param);

                if (iDelete > 0)
                {
                    CommitTransaction();
                }
                else
                {
                    RollBackTransaction();
                }
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                strError = ex.Message;
            }
            finally
            {
                Close();
            }
            return(iDelete);
        }
Пример #4
0
        private string DoAllNavigationtoPrint()
        {
            OrderPage orderPage = new OrderPage(driver);

            orderPage.ClickBack();
            DemandPage demandPage = new DemandPage(driver);

            demandPage.ClickBackToHome();
            MainPage mainPage = new MainPage(driver);

            mainPage.ClickEReturn();
            EReturn eReturPage = new EReturn(driver);

            eReturPage.ClickBackToPrint();
            PrintPage printPage = new PrintPage(driver);

            printPage.SelectYearAndVaigate(year);
            ReturnStatusPage statusListPage = new ReturnStatusPage(driver);
            string           message        = statusListPage.getInitiatedData();

            return(message);
        }
Пример #5
0
        private string DoNavigationForMobileVerificationCust()
        {
            MobileVerification mverify = new MobileVerification(driver);

            mverify.ClickBack();
            VerifyEmailMobile emailMobile = new VerifyEmailMobile(driver);

            emailMobile.ClickBack();
            MainPage mainPage = new MainPage(driver);

            mainPage.ClickEReturn();
            EReturn eReturPage = new EReturn(driver);

            eReturPage.ClickBackToPrint();
            PrintPage printPage = new PrintPage(driver);

            printPage.SelectYearAndVaigate(year);
            ReturnStatusPage statusListPage = new ReturnStatusPage(driver);
            string           message        = statusListPage.getInitiatedData();

            return(message);
        }
Пример #6
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        int UpdateRow = 0, UpdateRowDtls = 0;

        try
        {
            CheckQty();
            if (chkflag == false)
            {
                if (ViewState["EditId"] != null)
                {
                    Entity_damage.ReturnId = Convert.ToInt32(ViewState["EditId"]);
                }
                Entity_damage.PreparedBy = Convert.ToInt32(Session["UserID"]);
                Entity_damage.UserID     = Convert.ToInt32(Session["UserId"]);
                Entity_damage.LoginDate  = DateTime.Now;
                if (chkReturnDebitNote.Checked)
                {
                    Entity_damage.IsDebitNote = 1;
                }
                else
                {
                    Entity_damage.IsDebitNote = 0;
                }
                UpdateRow = Obj_damage.UpdateRecord(ref Entity_damage, out StrError);
                if (UpdateRow > 0)
                {
                    if (ViewState["CurrentTable"] != null)
                    {
                        for (int i = 0; i < GrdInward.Rows.Count; i++)
                        {
                            if (((TextBox)GrdInward.Rows[i].FindControl("GrdtxtReturnQty")).Text != "0" && ((TextBox)GrdInward.Rows[i].FindControl("GrdtxtReturnQty")).Text != String.Empty)
                            {
                                Entity_damage.ReturnId      = Convert.ToInt32(ViewState["EditId"]);
                                Entity_damage.ItemId        = Convert.ToInt32(GrdInward.Rows[i].Cells[2].Text.ToString());
                                Entity_damage.InwardQty     = Convert.ToDecimal(GrdInward.Rows[i].Cells[8].Text.ToString());
                                Entity_damage.DamageQty     = Convert.ToDecimal(GrdInward.Rows[i].Cells[9].Text.ToString());
                                Entity_damage.PrevReturnQty = Convert.ToDecimal(GrdInward.Rows[i].Cells[10].Text.ToString());
                                if (((TextBox)GrdInward.Rows[i].FindControl("GrdtxtReturnQty")).Text == " " || string.IsNullOrEmpty(((TextBox)GrdInward.Rows[i].FindControl("GrdtxtReturnQty")).Text))
                                {
                                    Entity_damage.ReturnQty = 0;
                                }
                                else
                                {
                                    Entity_damage.ReturnQty = Convert.ToDecimal(((TextBox)GrdInward.Rows[i].FindControl("GrdtxtReturnQty")).Text);
                                }
                                Entity_damage.InwardRate = Convert.ToDecimal(GrdInward.Rows[i].Cells[12].Text.ToString());
                                Entity_damage.Reason     = (((TextBox)GrdInward.Rows[i].FindControl("TxtReason")).Text);

                                //StockDetails
                                Entity_damage.ItemDesc        = Convert.ToString(GrdInward.Rows[i].Cells[5].Text.ToString());
                                Entity_damage.StockUnitId     = Convert.ToInt32(GrdInward.Rows[i].Cells[6].Text.ToString());
                                Entity_damage.StockDate       = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                                Entity_damage.StockLocationID = Convert.ToInt32(Session["CafeteriaId"]);
                                if (chkReturnDebitNote.Checked)
                                {
                                    Entity_damage.IsDebitNote = 1;
                                }
                                else
                                {
                                    Entity_damage.IsDebitNote = 0;
                                }
                                UpdateRowDtls = Obj_damage.InsertDetailsRecord(ref Entity_damage, out StrError);
                            }
                        }
                    }
                    if (UpdateRow > 0)
                    {
                        obj_Comm.ShowPopUpMsg("Record Updated Successfully", this.Page);
                        MakeControlEmpty();
                        MakeEmptyForm();
                        Entity_damage = null;
                        Obj_damage    = null;
                    }
                }
            }
        }
        catch (Exception ex) { throw new Exception(ex.Message); }
    }
Пример #7
0
        public int InsertDetailsRecord(ref EReturn Entity_damage, out string strError)
        {
            int iInsert = 0;

            strError = string.Empty;
            try
            {
                SqlParameter pAction        = new SqlParameter(EReturn._Action, SqlDbType.BigInt);
                SqlParameter pReturnId      = new SqlParameter(EReturn._ReturnId, SqlDbType.BigInt);
                SqlParameter pItemId        = new SqlParameter(EReturn._ItemId, SqlDbType.BigInt);
                SqlParameter pInwardQty     = new SqlParameter(EReturn._InwardQty, SqlDbType.Decimal);
                SqlParameter pInwardRate    = new SqlParameter(EReturn._InwardRate, SqlDbType.Decimal);
                SqlParameter pDamageQty     = new SqlParameter(EReturn._DamageQty, SqlDbType.Decimal);
                SqlParameter pPrevReturnQty = new SqlParameter(EReturn._PrevReturnQty, SqlDbType.Decimal);
                SqlParameter pReturnQty     = new SqlParameter(EReturn._ReturnQty, SqlDbType.Decimal);
                SqlParameter pReason        = new SqlParameter(EReturn._Reason, SqlDbType.NVarChar);
                SqlParameter pItemDesc      = new SqlParameter(EReturn._ItemDesc, SqlDbType.NVarChar);
                SqlParameter pIsDebitNote   = new SqlParameter(EReturn._IsDebitNote, SqlDbType.BigInt);
                //StockDetails
                SqlParameter pStockUnitId     = new SqlParameter(EReturn._StockUnitId, SqlDbType.BigInt);
                SqlParameter pStockDate       = new SqlParameter(EReturn._StockDate, SqlDbType.DateTime);
                SqlParameter pStockLocationID = new SqlParameter(EReturn._StockLocationID, SqlDbType.BigInt);

                pAction.Value        = 7;
                pReturnId.Value      = Entity_damage.ReturnId;
                pItemId.Value        = Entity_damage.ItemId;
                pIsDebitNote.Value   = Entity_damage.IsDebitNote;
                pInwardQty.Value     = Entity_damage.InwardQty;
                pInwardRate.Value    = Entity_damage.InwardRate;
                pDamageQty.Value     = Entity_damage.DamageQty;
                pPrevReturnQty.Value = Entity_damage.PrevReturnQty;
                pReturnQty.Value     = Entity_damage.ReturnQty;
                pReason.Value        = Entity_damage.Reason;
                pItemDesc.Value      = Entity_damage.ItemDesc;
                //StockDetails
                pStockUnitId.Value     = Entity_damage.StockUnitId;
                pStockDate.Value       = Entity_damage.StockDate;
                pStockLocationID.Value = Entity_damage.StockLocationID;

                SqlParameter[] Param = new SqlParameter[] { pAction, pReturnId, pItemId, pInwardQty, pInwardRate, pDamageQty, pPrevReturnQty, pReturnQty, pReason,
                                                            pStockUnitId, pStockDate, pStockLocationID, pItemDesc, pIsDebitNote };

                Open(CONNECTION_STRING);
                BeginTransaction();

                iInsert = SQLHelper.ExecuteNonQuery(_Connection, _Transaction, CommandType.StoredProcedure, EReturn.SP_ReturnMaster, Param);

                if (iInsert > 0)
                {
                    CommitTransaction();
                }
                else
                {
                    RollBackTransaction();
                }
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                strError = ex.Message;
            }
            finally
            {
                Close();
            }
            return(iInsert);
        }