コード例 #1
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            Ob = IntialiazeValueInGlobal();
            string res = string.Empty;

            if (Ob.PackageType != "Qty / Item" && Ob.PackageType != "Flat Qty")
            {
                grdBind.DataSource = null;
                grdBind.DataBind();
            }

            res = BAL.BALFactory.Instance.BL_PackageMaster.UpdatePackage(Ob, grdBind);
            if (res == "Record Saved")
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "setDivMouseOver('Green', '#999999');", true);
                lblMsg.Text = "Package" + " " + txtTitle.Text + " " + "updated successfully.";
                ResetAllField();
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "setDivMouseOver('Red', '#999999');", true);
                lblErr.Text = res.ToString();
            }
            SetGridForEntryWhenNoDataIsPresent();
        }
コード例 #2
0
        public bool CheckPackageAssignToCustomer(DTO.PackageMaster Ob)
        {
            SqlCommand    cmd    = new SqlCommand();
            SqlDataReader sdr    = null;
            bool          status = false;

            try
            {
                cmd.CommandText = "sp_PackageMaster";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@CustomerCode", Ob.CustomerCode);
                cmd.Parameters.AddWithValue("@BranchId", Ob.BranchId);
                cmd.Parameters.AddWithValue("@Flag", 14);
                sdr = PrjClass.ExecuteReader(cmd);
                if (sdr.Read())
                {
                    status = true;
                }
                else
                {
                    status = false;
                }
            }
            catch (Exception ex) { }
            finally
            {
                sdr.Close();
                sdr.Dispose();
                cmd.Dispose();
            }
            return(status);
        }
コード例 #3
0
        public DataSet ShowAllAssignPackage(DTO.PackageMaster Ob)
        {
            DataSet    ds  = new DataSet();
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "sp_PackageMaster";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@BranchId", Ob.BranchId);
            cmd.Parameters.AddWithValue("@Flag", 10);
            ds = PrjClass.GetData(cmd);
            return(ds);
        }
コード例 #4
0
        public string DeleteAssignPackage(DTO.PackageMaster Ob)
        {
            string     res = "";
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "sp_PackageMaster";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@CustomerCode", Ob.CustomerCode);
            cmd.Parameters.AddWithValue("@AssignId", Ob.AssignId);
            cmd.Parameters.AddWithValue("@BranchId", Ob.BranchId);
            cmd.Parameters.AddWithValue("@Flag", 16);
            res = PrjClass.ExecuteNonQuery(cmd);
            return(res);
        }
コード例 #5
0
        public string DeletePackage(DTO.PackageMaster Ob)
        {
            string res = "";

            if (CheckPackageInAssignTable(Ob) == true)
            {
                res = "Package in use In Assign Screen.";
                return(res);
            }
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "sp_PackageMaster";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@PackageId", Ob.PackageId);
            cmd.Parameters.AddWithValue("@BranchId", Ob.BranchId);
            cmd.Parameters.AddWithValue("@Flag", "5");
            res = PrjClass.ExecuteNonQuery(cmd);
            return(res);
        }
コード例 #6
0
        /// <summary>
        /// Assign Package Function
        /// </summary>
        /// <param name="Ob"></param>
        /// <returns></returns>
        public string SaveAssignPackage(DTO.PackageMaster Ob, bool isQtyItemBased = false)
        {
            string     res      = "";
            int        AssignId = PrjClass.getNewIDAccordingBID("AssignPackage", "AssignId", Ob.BranchId);
            SqlCommand cmd      = new SqlCommand();

            cmd.CommandText = "sp_PackageMaster";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@AssignId", AssignId);
            cmd.Parameters.AddWithValue("@PackageId", Ob.PackageId);
            cmd.Parameters.AddWithValue("@StartValue", Ob.StartValue);
            cmd.Parameters.AddWithValue("@CustomerCode", Ob.CustomerCode);
            cmd.Parameters.AddWithValue("@StartDate", Ob.StartDate);
            cmd.Parameters.AddWithValue("@EndDate", Ob.EndDate);
            cmd.Parameters.AddWithValue("@Active", Ob.Active);
            cmd.Parameters.AddWithValue("@BranchId", Ob.BranchId);
            cmd.Parameters.AddWithValue("@PaymentTypes", Ob.PaymentTypes);
            cmd.Parameters.AddWithValue("@PaymentDetail", Ob.PaymentDetails);
            cmd.Parameters.AddWithValue("@MembershipId", Ob.MembershipId);
            cmd.Parameters.AddWithValue("@BarCode", Ob.BarCode);
            cmd.Parameters.AddWithValue("@DefaultDiscountRate", Ob.CurDiscount);
            cmd.Parameters.AddWithValue("@Recurrence", Ob.Recurrence);
            cmd.Parameters.AddWithValue("@PackageTotalCost", Ob.PackageTotalCost);
            cmd.Parameters.AddWithValue("@CustEmail", Ob.CustomerEmailID);
            cmd.Parameters.AddWithValue("@Custmobile", Ob.CustomerMobile);
            cmd.Parameters.AddWithValue("@Flag", 9);
            res = PrjClass.ExecuteNonQuery(cmd);
            if (isQtyItemBased && res == "Record Saved")
            {
                var dt   = DateTime.Parse(Ob.StartDate);
                var dt2  = DateTime.Parse(Ob.EndDate);
                var dd   = dt2 - dt;
                var _res = SaveInRecurrence(AssignId, dt, (int)dd.TotalDays + 1, int.Parse(Ob.Recurrence), Ob.BranchId);
                if (_res != "Record Saved")
                {
                    return(_res);
                }
            }
            return(res);
        }
コード例 #7
0
 public string UpdateAssignPackage(DTO.PackageMaster Ob, bool isQtyItemBased = false)
 {
     return(DAL.DALFactory.Instance.DAL_PackageMaster.UpdateAssignPackage(Ob, isQtyItemBased));
 }
コード例 #8
0
        public string UpdatePackage(DTO.PackageMaster Ob, GridView grdQtyDetail)
        {
            string    res = "", res1 = "";
            int       TotalQty   = 0;
            double    PackageRat = 0;
            ArrayList date       = DAL.DALFactory.Instance.DAL_DateAndTime.getDateAndTimeAccordingToZoneTime(Ob.BranchId);

            if (Ob.CustomerCode != Ob.PackageName)
            {
                if (CheckDuplicatePackage(Ob) == true)
                {
                    res = "Package name already exist.";
                    return(res);
                }
            }
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "sp_PackageMaster";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@PackageId", Ob.PackageId);
            cmd.Parameters.AddWithValue("@PackageName", Ob.PackageName.Trim());
            cmd.Parameters.AddWithValue("@PackageType", Ob.PackageType);
            cmd.Parameters.AddWithValue("@PackageCost", Ob.PackageCost);
            cmd.Parameters.AddWithValue("@BenefitType", Ob.BenefitType);
            cmd.Parameters.AddWithValue("@BenefitValue", Ob.BenefitValue);
            cmd.Parameters.AddWithValue("@Active", Ob.Active);
            cmd.Parameters.AddWithValue("@BranchId", Ob.BranchId);
            cmd.Parameters.AddWithValue("@CreateDate", date[0]);
            cmd.Parameters.AddWithValue("@TaxType", Ob.TaxType);
            cmd.Parameters.AddWithValue("@TotalQty", Ob.TotalQty);

            cmd.Parameters.AddWithValue("@Recurrence", Ob.Recurrence);
            cmd.Parameters.AddWithValue("@StartDate", Ob.StartDate);
            cmd.Parameters.AddWithValue("@EndDate", Ob.EndDate);

            if (grdQtyDetail.Rows.Count > 0)
            {
                if (Ob.PackageType != "Flat Qty")
                {
                    for (int iRow = 0; iRow < grdQtyDetail.Rows.Count; iRow++)
                    {
                        TotalQty += Convert.ToInt32(((Label)grdQtyDetail.Rows[iRow].Cells[1].FindControl("lblQty")).Text);
                    }
                }
                else
                {
                    TotalQty = Ob.TotalQty;
                }
                PackageRat = Ob.PackageCost / (TotalQty * int.Parse(Ob.Recurrence));
            }
            cmd.Parameters.AddWithValue("@PackageRate", Math.Round(PackageRat, 2));
            cmd.Parameters.AddWithValue("@Flag", 2);
            res = PrjClass.ExecuteNonQuery(cmd);
            if (Ob.PackageType != "Qty / Item" && Ob.PackageType != "Flat Qty")
            {
                SqlCommand cmd1 = new SqlCommand();
                cmd1.CommandText = "sp_PackageMaster";
                cmd1.CommandType = CommandType.StoredProcedure;
                cmd1.Parameters.AddWithValue("@PackageId", Ob.PackageId);
                cmd1.Parameters.AddWithValue("@BranchId", Ob.BranchId);
                cmd1.Parameters.AddWithValue("@Flag", 41);
                PrjClass.ExecuteNonQuery(cmd1);
                grdQtyDetail.DataSource = null;
                grdQtyDetail.DataBind();
            }
            if (grdQtyDetail.Rows.Count > 0)
            {
                res1 = SaveInPackageQtyDetail(grdQtyDetail, Convert.ToInt32(Ob.PackageId), Ob.BranchId, Ob.TotalQty, Ob.PackageType);
            }
            return(res);
        }
コード例 #9
0
 public bool CheckPackageInAssignTable(DTO.PackageMaster Ob)
 {
     return(DAL.DALFactory.Instance.DAL_PackageMaster.CheckPackageInAssignTable(Ob));
 }
コード例 #10
0
 public DataSet GetAllPackgaeDetail(DTO.PackageMaster Ob)
 {
     return(DAL.DALFactory.Instance.DAL_PackageMaster.GetAllPackgaeDetail(Ob));
 }
コード例 #11
0
 public DataSet BindPackageDropDown(DTO.PackageMaster Ob)
 {
     return(DAL.DALFactory.Instance.DAL_PackageMaster.BindPackageDropDown(Ob));
 }
コード例 #12
0
 public string UpdateMarkComplete(DTO.PackageMaster Ob)
 {
     return(DAL.DALFactory.Instance.DAL_PackageMaster.UpdateMarkComplete(Ob));
 }
コード例 #13
0
 public DataSet ShowAllAssignPackage(DTO.PackageMaster Ob)
 {
     return(DAL.DALFactory.Instance.DAL_PackageMaster.ShowAllAssignPackage(Ob));
 }
コード例 #14
0
 public bool CheckPackageAssignToCustomer(DTO.PackageMaster Ob)
 {
     return(DAL.DALFactory.Instance.DAL_PackageMaster.CheckPackageAssignToCustomer(Ob));
 }
コード例 #15
0
 public string SavePackage(DTO.PackageMaster Ob, GridView grdQtyDetail)
 {
     return(DAL.DALFactory.Instance.DAL_PackageMaster.SavePackage(Ob, grdQtyDetail));
 }
コード例 #16
0
 public DataSet GetAssignDetails(DTO.PackageMaster Ob)
 {
     return(DAL.DALFactory.Instance.DAL_PackageMaster.GetAssignDetails(Ob));
 }
コード例 #17
0
 public bool CheckOrginalUser(DTO.PackageMaster Ob)
 {
     return(DAL.DALFactory.Instance.DAL_PackageMaster.CheckOrginalUser(Ob));
 }
コード例 #18
0
 public string DeleteAssignPackage(DTO.PackageMaster Ob)
 {
     return(DAL.DALFactory.Instance.DAL_PackageMaster.DeleteAssignPackage(Ob));
 }
コード例 #19
0
 public DataSet SearchPackage(DTO.PackageMaster Ob)
 {
     return(DAL.DALFactory.Instance.DAL_PackageMaster.SearchPackage(Ob));
 }