示例#1
0
        protected void ChangeData(object sender, EventArgs e)
        {
            int Description = Convert.ToInt32(ddlServices.SelectedValue);
            QuotationServicesModel objQuotation = client.GetServiceByID(Description);

            txtSerDes.Text = objQuotation.ServiceDesc;
            decimal money = objQuotation.ServiceCost;
            string  rate  = String.Format("{0:#.00}", money);

            txtRate.Text = rate;
            SubTotalcal();
        }
示例#2
0
        public static int SaveService(QuotationServicesModel model)
        {
            string query = "SaveService";

            DbParameter[] ObjParam = new DbParameter[7];

            ObjParam[0] = new DbParameter("@QuotationID", DbParameter.DbType.Int, 0, model.QuotationID);
            ObjParam[1] = new DbParameter("@fkiServiceID", DbParameter.DbType.Int, 0, model.fkiServiceID);
            ObjParam[2] = new DbParameter("@Quantity", DbParameter.DbType.Int, 0, model.Quantity);
            ObjParam[3] = new DbParameter("@LastModified", DbParameter.DbType.DateTime, 0, model.lastModified);
            ObjParam[4] = new DbParameter("@ModifiedUser", DbParameter.DbType.VarChar, 0, model.modifiedUser);
            ObjParam[5] = new DbParameter("@ServiceRate", DbParameter.DbType.Money, 0, model.ServiceRate);
            ObjParam[6] = new DbParameter("@pkiQuotationSelectionID", DbParameter.DbType.Int, 0, model.pkiQuotationSelectionID);

            return(Convert.ToInt32(DbConnection.GetScalarValue(CommandType.StoredProcedure, query, ObjParam)));
        }
示例#3
0
        protected void btncrtService_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    // QuotationServicesModel objSer = client.SelectQuotationByQuotationId(ID, ParlourId);
                    QuotationServicesModel objSer = null;
                    if (objSer != null)
                    {
                        //ShowMessage(ref lblMessage, MessageType.Danger, "Member Dependenc  Already Exists.");
                    }
                    else
                    {
                        objSer = new QuotationServicesModel();
                        if (ViewState["ID"] != null)
                        {
                            objSer.pkiQuotationSelectionID = Convert.ToInt32(ViewState["ID"]);
                            ViewState["ID"] = null;
                        }
                        objSer.QuotationID  = QuotationID;
                        objSer.fkiServiceID = Convert.ToInt32(ddlServices.SelectedValue);
                        objSer.Quantity     = Convert.ToInt32(txtNumber.Text);
                        objSer.lastModified = System.DateTime.Now;
                        objSer.modifiedUser = UserName;
                        objSer.ServiceRate  = Convert.ToDecimal(txtRate.Text);

                        int a = client.SaveService(objSer);
                        ViewState["QuotationID"] = a;
                        ShowMessage(ref lblMessage, MessageType.Success, "Quotation Successfully Saved.");

                        bindServiceListList();
                        ClearService();
                        DiscountCal();
                    }
                }
                catch (Exception ex)
                {
                    ShowMessage(ref lblMessage, MessageType.Danger, ex.Message);
                }
            }
        }
示例#4
0
        public void BindServiceToUpdate()
        {
            int serviceID = Convert.ToInt32(ViewState["ID"]);
            QuotationServicesModel model = client.SelectServiceByQouAndID(QuotationID, serviceID);

            if ((model == null) || (model.QuotationID != QuotationID))
            {
                Response.Write("<script>alert('Sorry!you are not authorized to perform edit on this Quotation.');</script>");
            }
            else
            {
                ddlServices.SelectedValue = model.pkiServiceID.ToString();
                txtSerDes.Text            = model.ServiceDesc;
                txtNumber.Text            = model.Quantity.ToString();
                txtRate.Text = model.ServiceRate.ToString();


                AddServ.Text = "Update";
            }
        }
示例#5
0
        protected void btnPackageService_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    List <PackageServicesSelectionModel> modelList = client.GetPackageService(this.ParlourId, ddlPackage.SelectedValue).ToList();
                    //FuneralServiceSelectModel objSer = null;

                    QuotationServicesModel objSer = null;

                    foreach (var item in modelList)
                    {
                        objSer = new QuotationServicesModel();
                        if (ViewState["ID"] != null)
                        {
                            objSer.pkiQuotationSelectionID = Convert.ToInt32(ViewState["ID"]);
                            ViewState["ID"] = null;
                        }
                        objSer.QuotationID  = QuotationID;
                        objSer.fkiServiceID = item.fkiServiceID;
                        objSer.Quantity     = 1;
                        objSer.lastModified = System.DateTime.Now;
                        objSer.modifiedUser = UserName;
                        objSer.ServiceRate  = item.ServiceCost;
                        client.SaveService(objSer);
                    }
                    ShowMessage(ref lblMessage, MessageType.Success, "Package Successfully Added.");

                    bindServiceListList();
                    ClearService();
                    DiscountCal();
                }
                catch (Exception ex)
                {
                    ShowMessage(ref lblMessage, MessageType.Danger, ex.Message);
                }
            }
        }
示例#6
0
 public int SaveService(QuotationServicesModel model)
 {
     return(QuotationBAL.SaveService(model));
 }