Exemplo n.º 1
0
        /// <summary>
        /// Date Created: 18/08/2011
        /// Created By: Gabriel Oquialda
        /// (description) Get vendor vehicle contract List<ContractVehicle>
        /// ---------------------------------------------------
        /// Date Modified:  16/Aug/2013
        /// Modified By:    Josephine Gad
        /// (description)   Change DataTable to void and put it in Session
        /// </summary>
        /// </summary>
        public void GetVendorVehicleContractList()
        {
            //DataView dv = null;
            ////DataTable dt = BLL.ContractBLL.vendorVehicleGetContractList(uoTextBoxVehicle.Text, GlobalCode.Field2String(Session["UserName"]));
            //DataTable dt = BLL.ContractBLL.GetVendorVehicleBranchContractByBranchID(Request.QueryString["vmId"]);

            //if (dt.Rows.Count > 0)
            //{
            //    ucLabelVehicle.Text = dt.Rows[0]["colVendorBranchNameVarchar"].ToString() + " Contract List";
            //    dv = (DataView)dt.DefaultView;
            //    dv.Sort = upDropDownListSort.SelectedValue + " desc";
            //    //dv.Sort = upDropDownListSort.SelectedValue + ", colVendorBranchNameVarchar"; //", CONTRACTNAME";
            //    uoVehicleContractList.DataSource = dv;
            //    uoVehicleContractList.DataBind();
            //}


            List <ContractVehicle> list = new List <ContractVehicle>();

            list = ContractBLL.GetVendorVehicleBranchContractByBranchID(GlobalCode.Field2String(Request.QueryString["vmId"]), uoHiddenFieldUser.Value);

            if (list.Count > 0)
            {
                ucLabelVehicle.Text = list[0].VehicleName + " Contract List";
            }
            else
            {
                ucLabelVehicle.Text = "Contract List";
            }

            uoVehicleContractList.DataSource = list;
            uoVehicleContractList.DataBind();
        }
Exemplo n.º 2
0
        private void BindContract(int slnID)
        {
            DropGetList.Items.Clear();
            ContractBLL BLL = new ContractBLL();
            DataSet     ds  = BLL.GetList("SlnID=" + slnID);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DropGetList.DataSource     = ds;
                DropGetList.DataTextField  = "uname";
                DropGetList.DataValueField = "ID";
                DropGetList.DataBind();
            }
            string conId = ContractID;

            if (!string.IsNullOrEmpty(conId) && conId != "0")
            {
                try
                {
                    DropGetList.SelectedValue = conId;
                }
                catch
                {
                }
            }
        }
        /// <summary>
        /// Author: Charlene Remotigue
        /// Date Created: 08/12/2011
        /// Description: save hotel rooms
        /// </summary>
        /// <param name="ContractBranchId"></param>
        protected void SaveRoomList(int ContractBranchId)
        {
            DataTable roomList = (DataTable)ViewState["Rooms"];

            ContractBLL.SaveContractPortAgentHotelRooms(roomList, ContractBranchId,
                                                        Int32.Parse(Request.QueryString["cId"]));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 初始化加载
        /// </summary>
        public void Bind()
        {
            ddlAgreement.Items.Clear();
            DataSet ds = SlnID == 0 ? new AgreementBLL().GetList("", "0") : new AgreementBLL().GetList(" gameid=" + SlnID, SlnID.ToString());

            ddlAgreement.DataSource     = ds;
            ddlAgreement.DataTextField  = "Title";
            ddlAgreement.DataValueField = "AgreementID";
            ddlAgreement.DataBind();

            if (ddlAgreement.Items.Count == 0)
            {
                ddlAgreement.Items.Add(new ListItem("无接口分类", "0"));
            }
            if (!Request.QueryString["ID"].Equals(""))
            {
                int           ID    = Convert.ToInt32(Request.QueryString["ID"]);
                int           slnID = Convert.ToInt32(Request.QueryString["slnID"]);
                ContractBLL   BLL   = new ContractBLL();
                ContractModel model = new ContractModel();
                model                      = BLL.GetModel(ContractID, SlnID);
                txtDescption.Text          = model.Descption;
                ddlAgreement.SelectedValue = model.AgreementID.ToString();
            }
        }
        /// <summary>
        /// Author: Charlene Remotigue
        /// Date Created: 07/12/2011
        /// Description: Load currency for the given branch
        /// </summary>
        private void CurrencyLoad()
        {
            IDataReader drCurrency = null;

            try
            {
                drCurrency = ContractBLL.GetCurrencyByCountry(uoHiddenFieldCountryId.Value);
                if (drCurrency.Read())
                {
                    uoTextBoxCurrency.Text        = drCurrency["colCurrencyNameVarchar"].ToString();
                    uoHiddenFieldCurrencyId.Value = drCurrency["colCurrencyIDInt"].ToString();
                }
                else
                {
                    uoTextBoxCurrency.Text = "No available currency.";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (drCurrency != null)
                {
                    drCurrency.Close();
                    drCurrency.Dispose();
                }
            }
        }
Exemplo n.º 6
0
        private void Bind(int slnID)
        {
            ddlSolution.Items.Clear();
            DataSet dssln = new SolutionBLL().GetList("");

            ddlSolution.DataSource     = dssln;
            ddlSolution.DataTextField  = "SlnName";
            ddlSolution.DataValueField = "SlnID";
            ddlSolution.DataBind();

            var slnTable = dssln.Tables[0];

            slnTable.PrimaryKey = new DataColumn[] { slnTable.Columns["SlnID"] };
            var row = slnTable.Rows.Find(slnID);

            if (row != null)
            {
                lblSlnName.Text = row["SlnName"].ToString();
            }

            ddContract.Items.Clear();
            ContractBLL BLL = new ContractBLL();
            DataSet     ds  = BLL.GetList("SlnID=" + slnID);

            if (ds.Tables[0].Rows.Count > 0)
            {
                ddContract.DataSource     = ds;
                ddContract.DataTextField  = "uname";
                ddContract.DataValueField = "ID";
                ddContract.DataBind();

                ddContract.SelectedValue = ContractID.ToString();
            }
        }
Exemplo n.º 7
0
        private void GetCurrency()
        {
            DataTable dt = null;

            try
            {
                dt = ContractBLL.CurrencyLoad();
                if (dt.Rows.Count > 0)
                {
                    uoDropDownListCurrency.DataSource     = dt;
                    uoDropDownListCurrency.DataTextField  = "colCurrencyNameVarchar";
                    uoDropDownListCurrency.DataValueField = "colCurrencyIDInt";
                    uoDropDownListCurrency.DataBind();
                }
                else
                {
                    uoDropDownListCurrency.DataBind();
                }
                uoDropDownListCurrency.Items.Insert(0, new ListItem("--Select Currency--", "0"));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
Exemplo n.º 8
0
        public ActionResult FindPageList(int state = -1, string createUID = "", string beginSigningDate = "", string endSigningDate = "")
        {
            var recordCount = 0;
            var list        = new ContractBLL().GetContractListBySearch(state, createUID, beginSigningDate, endSigningDate, out recordCount);

            return(ToDataGrid(list, recordCount));
        }
        protected void LoadDetails()
        {
            IDataReader dr = null;

            try
            {
                dr = ContractBLL.LoadPortAgentContractOthers(Request.QueryString["ServiceId"]);
                if (dr.Read())
                {
                    uoTextBoxRemarks.Text = dr["colRemarksVarchar"].ToString();
                    uoLabelRate.Text      = dr["colServiceRateMoney"].ToString().Remove(dr["colServiceRateMoney"].ToString().Length - 2);
                    uoLabelCurrency.Text  = dr["colCurrencyNameVarchar"].ToString();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dr != null)
                {
                    dr.Dispose();
                }
            }
        }
        protected void uoButtonSave_Click(object sender, EventArgs e)
        {
            string strLogDescription;
            string strFunction;

            ContractBLL.SaveContractPortAgentOther(Request.QueryString["ServiceId"], Request.QueryString["pId"], Request.QueryString["vType"],
                                                   uoTextBoxRate.Text, GlobalCode.Field2String(Session["UserName"]), Request.QueryString["cId"], uoTextBoxRemarks.Text, uoHiddenFieldDetailId.Value,
                                                   uoDropDownListCurrency.SelectedValue);

            if (Request.QueryString["ServiceId"] == "0" || Request.QueryString["ServiceId"] == null)
            {
                //Insert log audit trail (Gabriel Oquialda - 18/11/2011)
                strLogDescription = "Service Provider contract other added.";
                strFunction       = "uoButtonSave_Click";

                DateTime dateNow = CommonFunctions.GetCurrentDateTime();

                //BLL.AuditTrailBLL.InsertLogAuditTrail(strLogDescription, strFunction, Path.GetFileName(Request.Path),
                //                                      CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
            }
            else
            {
                //Insert log audit trail (Gabriel Oquialda - 18/11/2011)
                strLogDescription = "Service Provider contract other updated.";
                strFunction       = "uoButtonSave_Click";

                DateTime dateNow = CommonFunctions.GetCurrentDateTime();

                //BLL.AuditTrailBLL.InsertLogAuditTrail(strLogDescription, strFunction, Path.GetFileName(Request.Path),
                //                                      CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
            }

            OpenParentPage();
        }
Exemplo n.º 11
0
        protected void TreeList_SelectedNodeChanged(object sender, EventArgs e)
        {
            if (TreeList.SelectedNode.Target != "0")
            {
                ddlAgreement.SelectedValue = TreeList.SelectedNode.Parent.Value;
                ContractBLL BLL = new ContractBLL();
                DataSet     ds  = ddlAgreement.SelectedValue == "0" ? BLL.GetList("AgreementID>=0") : BLL.GetList("AgreementID=" + ddlAgreement.SelectedValue);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DropGetList.DataSource     = ds;
                    DropGetList.DataTextField  = "uname";
                    DropGetList.DataValueField = "ID";
                    DropGetList.DataBind();
                }
                else
                {
                    DropGetList.Items.Clear();
                    DropGetList.Items.Add(new ListItem("无接口", "0"));
                }
                TreeList.SelectedNode.Checked  = true;
                TreeList.SelectedNode.Selected = true;

                DropGetList.SelectedValue = TreeList.SelectedValue;
                SetCookies(ddlSolution.Text, DropGetList.Text);
                QueryResult();
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// 获取合同预付的相关信息
        /// </summary>
        void GetBlockInfo(HttpContext context)
        {
            long id = 0;

            if (!string.IsNullOrEmpty(context.Request.QueryString["id"]) && long.TryParse(context.Request.QueryString["id"], out id))
            {
                var block = new ContractBlockBLL().GetBlockById(id);
                if (block != null)
                {
                    var contract = new ContractBLL().GetContract(block.contract_id);
                    if (contract != null)
                    {
                        decimal befotMoveNum = 0;
                        if (contract.type_id == (int)EMT.DoneNOW.DTO.DicEnum.CONTRACT_TYPE.RETAINER)
                        {
                            befotMoveNum = Convert.ToDecimal(new DAL.crm_account_dal().GetSingle($"SELECT round(b.rate*b.quantity - ifnull((SELECT sum(extended_price)FROM crm_account_deduction WHERE contract_block_id = b.id	AND delete_time = 0	),0),2) AS rate FROM ctt_contract_block b WHERE b.delete_time = 0 and b.id = {block.id} "));
                        }
                        else if (contract.type_id == (int)EMT.DoneNOW.DTO.DicEnum.CONTRACT_TYPE.BLOCK_HOURS)
                        {
                            befotMoveNum = Convert.ToDecimal(new DAL.crm_account_dal().GetSingle($"SELECT sum(round(b.rate - ifnull((SELECT sum(extended_price)FROM crm_account_deduction WHERE contract_block_id = b.id AND delete_time = 0 ),0),2)) AS rate FROM ctt_contract_block b WHERE b.delete_time = 0 and b.id ={block.id} "));
                        }

                        WriteResponseJson(new { contractName = contract.name, date = block.start_date.ToString("yyyy-MM-dd") + " - " + block.end_date.ToString("yyyy-MM-dd"), befotMoveNum = befotMoveNum.ToString("#0.0000") });
                    }
                }
            }
        }
Exemplo n.º 13
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            byte[] imageBytes = new byte[FileUpload1.PostedFile.InputStream.Length + 1];
            FileUpload1.PostedFile.InputStream.Read(imageBytes, 0, imageBytes.Length);

            ContractBLL.InsertAttachHotelContract(FileUpload1.FileName, imageBytes, imageBytes.Length, FileUpload1.PostedFile.ContentType);
        }
        protected void LoadDetails()
        {
            IDataReader dr = null;

            try
            {
                dr = ContractBLL.LoadPortAgentContractOthers(Request.QueryString["ServiceId"]);
                if (dr.Read())
                {
                    uoTextBoxRemarks.Text = dr["colRemarksVarchar"].ToString();
                    uoTextBoxRate.Text    = dr["colServiceRateMoney"].ToString().Remove(dr["colServiceRateMoney"].ToString().Length - 2);
                    uoDropDownListCurrency.SelectedValue = dr["colCurrencyInt"].ToString();
                    uoHiddenFieldDetailId.Value          = dr["colContractPortAgentServiceDetailIdInt"].ToString();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dr != null)
                {
                    dr.Dispose();
                }
            }
        }
Exemplo n.º 15
0
        //protected void LoadRooms()
        //{
        //    DataTable dt = null;
        //    try
        //    {
        //        dt = HotelBLL.HotelRoomTypeGetDetailsByBranch(uoHiddenFieldBranchId.Value);

        //        uoDropdownListRoom.Items.Clear();
        //        if (dt.Rows.Count > 0)
        //        {
        //            uoDropdownListRoom.DataSource = dt;
        //            uoDropdownListRoom.DataTextField = "colRoomNameVarchar";
        //            uoDropdownListRoom.DataValueField = "colRoomTypeID";

        //        }
        //        uoDropdownListRoom.Items.Insert(0, new ListItem("--Select Room Type--", "0"));
        //        uoDropdownListRoom.DataBind();

        //        if (dt.Rows.Count == 1)
        //        {
        //            uoDropdownListRoom.SelectedIndex = 1;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //    finally
        //    {
        //        if (dt != null)
        //        {
        //            dt.Dispose();
        //        }
        //    }
        //}

        protected void LoadCurrency()
        {
            IDataReader dr = null;

            try
            {
                if (uoHiddenFieldCountryId.Value == "")
                {
                    uoHiddenFieldCountryId.Value = "0";
                }

                dr = ContractBLL.GetCurrencyByCountry(uoHiddenFieldCountryId.Value);
                if (dr.Read())
                {
                    uoTextBoxCurrency.Text        = dr["colCurrencyNameVarchar"].ToString();
                    uoHiddenFieldCurrencyId.Value = dr["colCurrencyIDInt"].ToString();
                }
                else
                {
                    uoTextBoxCurrency.Text = "No available currency.";
                }
                uoTextBoxCurrency.ReadOnly = true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dr != null)
                {
                    dr.Dispose();
                }
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// Date Created: 10/11/2011
        /// Created By: Charlene Remotigue
        /// Description: loads currencies
        /// </summary>
        private void LoadCurrency()
        {
            DataTable CurrencyDataTable = null;

            try
            {
                //CurrencyDataTable = ContractBLL.GetCurrencyByCountry(uoHiddenFieldCountryId.Value);
                CurrencyDataTable = ContractBLL.CurrencyLoad();
                ListItem item = new ListItem("--Select Currency--", "0");
                uoDropDownListCurrency.Items.Clear();
                uoDropDownListCurrency.Items.Add(item);
                uoDropDownListCurrency.DataSource     = CurrencyDataTable;
                uoDropDownListCurrency.DataTextField  = "colCurrencyNameVarchar";
                uoDropDownListCurrency.DataValueField = "colCurrencyIDInt";
                uoDropDownListCurrency.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (CurrencyDataTable != null)
                {
                    CurrencyDataTable.Dispose();
                }
            }
        }
Exemplo n.º 17
0
 protected void uoButtonSave_Click(object sender, EventArgs e)
 {
     ContractBLL.SaveContractPortAgentMedicalDetails(Request.QueryString["ServiceId"], Request.QueryString["pId"],
                                                     Request.QueryString["vType"], uoTextBoxRate.Text, GlobalCode.Field2String(Session["UserName"]), Request.QueryString["cId"],
                                                     uoTextBoxDays.Text, uoHiddenFieldDetailId.Value);
     OpenParentPage();
 }
Exemplo n.º 18
0
        public IHttpActionResult Get(string externalReference)
        {
            try
            {
                ServiceBLL serviceBLL  = new ServiceBLL();
                UserBLL    userBLL     = new UserBLL();
                var        contractBLL = new ContractBLL();
                if (string.IsNullOrEmpty(externalReference))
                {
                    throw new Exception();
                }

                //var paymentInfo = await Task.Run(() => Payment.FindById(long.Parse(id)));

                //var extRef = paymentInfo.ExternalReference;
                //var status = paymentInfo.Status;
                var user = userBLL.GetById(Guid.Parse(externalReference.Split('/')[0]));

                if (user.Contract == null && user.Permissions.Where(p => p.Name != "Login").ToList().Count > 0)
                {
                    throw new BusinessException(Messages.ErrorContractUser);
                }

                if (user.Contract != null && user.Contract.Service.Id == Guid.Parse(externalReference.Split('/')[1]))
                {
                    if (user.Contract.ExpirationDate > DateTime.Now)
                    {
                        throw new BusinessException(Messages.ErrorContractExists);
                    }
                }


                ContractViewModel cvm = new ContractViewModel()
                {
                    User = user,

                    Service = serviceBLL.GetById(Guid.Parse(externalReference.Split('/')[1]))
                };

                user.Contract = cvm;


                if (!userBLL.Update(user))
                {
                    throw new BusinessException(Messages.ErrorContract);
                }


                var response = Request.CreateResponse(System.Net.HttpStatusCode.OK, Messages.SuccessfulContract);

                return(this.ResponseMessage(response));
            }
            catch (Exception ex)
            {
                var response = Request.CreateResponse(System.Net.HttpStatusCode.InternalServerError, Messages.Generic_Error);
                return(this.ResponseMessage(response));
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// 删除合同里程碑
        /// </summary>
        /// <param name="context"></param>
        /// <param name="id"></param>
        private void DeleteMilestone(HttpContext context, long id)
        {
            bool result = false;


            result = new ContractBLL().DeleteMilestone(id, LoginUserId);

            context.Response.Write(result);
        }
Exemplo n.º 20
0
        private void SetContractCompliance(HttpContext context)
        {
            var result     = false;
            var contractId = context.Request.QueryString["contract_id"];

            if (!string.IsNullOrEmpty(contractId))
            {
                result = new ContractBLL().SetContractCompliance(long.Parse(contractId), LoginUserId);
            }
            context.Response.Write(new EMT.Tools.Serialize().SerializeJson(result));
        }
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   25/Sep/2013
        /// Description:    Bind Currency
        /// </summary>
        private void BindCurrency()
        {
            List <Currency> listCurrency = new List <Currency>();

            if (Session["ContractCurrency"] != null)
            {
                listCurrency = (List <Currency>)Session["ContractCurrency"];
            }
            else
            {
                DataTable dt = null;
                DataView  dv = null;
                try
                {
                    dt      = ContractBLL.CurrencyLoad();
                    dv      = dt.DefaultView;
                    dv.Sort = "colCurrencyNameVarchar";
                    dt      = dv.ToTable();

                    listCurrency = (from a in dt.AsEnumerable()
                                    select new Currency
                    {
                        CurrencyID = GlobalCode.Field2Int(a["colCurrencyIDInt"]),
                        CurrencyName = GlobalCode.Field2String(a["colCurrencyNameVarchar"])
                    }).ToList();
                    Session["ContractCurrency"] = listCurrency;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    if (dt != null)
                    {
                        dt.Dispose();
                    }
                    if (dv != null)
                    {
                        dv.Dispose();
                    }
                }
            }

            uoDropDownListCurrency.Items.Clear();
            uoDropDownListCurrency.DataSource = listCurrency;

            uoDropDownListCurrency.DataTextField  = "CurrencyName";
            uoDropDownListCurrency.DataValueField = "CurrencyID";

            uoDropDownListCurrency.DataBind();
            uoDropDownListCurrency.Items.Insert(0, (new ListItem("--Select Currency--", "0")));
        }
        /// <summary>
        /// Author: Charlene Remotigue
        /// Date Created: 09/11/2011
        /// Description: load all currencies
        /// </summary>
        protected void LoadCurrency()
        {
            DataTable CurrencyDataTable = ContractBLL.CurrencyLoad();
            ListItem  item = new ListItem("--Select Currency--", "0");

            uoDropDownListCurrency.Items.Clear();
            uoDropDownListCurrency.Items.Add(item);
            uoDropDownListCurrency.DataSource     = CurrencyDataTable;
            uoDropDownListCurrency.DataTextField  = "colCurrencyNameVarchar";
            uoDropDownListCurrency.DataValueField = "colCurrencyIDInt";
            uoDropDownListCurrency.DataBind();
        }
Exemplo n.º 23
0
        private void CurrencyLoad()
        {
            /// <summary>
            /// Date Created: 25/08/2011
            /// Created By: Marco Abejar
            /// (description) Select all currency
            /// </summary>

            uoDropDownListCurrency.DataSource     = ContractBLL.CurrencyLoad();
            uoDropDownListCurrency.DataTextField  = "colCurrencyCodeVarchar";
            uoDropDownListCurrency.DataValueField = "colCurrencyIDInt";
            uoDropDownListCurrency.DataBind();
        }
Exemplo n.º 24
0
        protected void butSubmit_Click(object sender, EventArgs e)
        {
            ContractBLL   BLL   = new ContractBLL();
            ContractModel model = new ContractModel();

            model.ID          = ContractID;
            model.SlnID       = SlnID;
            model.Descption   = txtDescption.Text.Trim();
            model.AgreementID = Convert.ToInt32(ddlAgreement.SelectedValue);
            if (BLL.Update(model))
            {
                Response.Write("<script language=javascript>alert('修改成功!')</script>");
            }
        }
Exemplo n.º 25
0
        protected v_contract_summary summary; // 合同摘要

        protected void Page_Load(object sender, EventArgs e)
        {
            long id = 0;

            if (!long.TryParse(Request.QueryString["id"], out id))
            {
                id = 0;
            }

            var bll = new ContractBLL();

            summary  = bll.GetContractSummary(id);
            contract = bll.GetContract(id);
        }
Exemplo n.º 26
0
        public AdminController()
        {
            _ClientBll   = new ClientBLL();
            _carBll      = new CarBLL();
            _contractBll = new ContractBLL();
            _employeeBll = new EmployeeBLL();
            _serviceBll  = new ServiceBLL();

            ViewData["Clients"]   = _clients;
            ViewData["Cars"]      = _cars;
            ViewData["Contracts"] = _contracts;
            ViewData["Employees"] = _employees;
            ViewData["Services"]  = _services;
        }
Exemplo n.º 27
0
        private void UpdateStatus(bool complated)
        {
            ContractBLL BLL = new ContractBLL();

            if (BLL.UpdateStatus(Convert.ToInt32(DropGetList.Text), Convert.ToInt32(ddlSolution.Text), complated))
            {
                //Response.Write("<script language=javascript>alert('提交成功!');</script>");
                QueryResult();
                Bind();
            }
            else
            {
                Response.Write("<script language=javascript>alert('提交失败!')</script>");
            }
        }
        /// <summary>
        /// Date Created:   06/Feb/2014
        /// Created By:     Josephine Gad
        /// (description)   Get Contract Details
        /// </summary>
        private void PortAgentGetContractDetail()
        {
            if (GlobalCode.Field2Int(uoHiddenFieldContractId.Value) > 0)
            {
                ContractBLL.GetPortAgentContractByContractID(uoHiddenFieldContractId.Value, uoHiddenFieldBranchId.Value, 0);

                List <ContractPortAgentDetails> list = new List <ContractPortAgentDetails>();
                list = (List <ContractPortAgentDetails>)Session["ContractPortAgentDetails"];

                if (list.Count > 0)
                {
                    ucLabelContractStatus.Text  = list[0].ContractStatus;
                    uoTextBoxContractTitle.Text = list[0].ContractName;
                    uoTextBoxPortAgentName.Text = list[0].PortAgentName;

                    uoTextBoxCountry.Text = list[0].CountryName;
                    uoTextBoxCity.Text    = list[0].CityName;

                    uoTextBoxRemarks.Text = list[0].Remarks;

                    uoCheckBoxAirportToHotel.Checked = list[0].IsAirportToHotel;
                    uoCheckBoxHotelToShip.Checked    = list[0].IsHotelToShip;

                    if (list[0].ContractDateStart != null)
                    {
                        uoTextBoxContractStartDate.Text = list[0].ContractDateStart.Value.ToString("MM/dd/yyyy");
                    }
                    if (list[0].ContractDateEnd != null)
                    {
                        uoTextBoxContractEndDate.Text = list[0].ContractDateEnd.Value.ToString("MM/dd/yyyy");
                    }
                    uoTextBoxCurrency.Text = list[0].CurrencyName;

                    uoCheckBoxListBrand.Items[0].Selected = list[0].IsRCI;
                    uoCheckBoxListBrand.Items[1].Selected = list[0].IsAZA;
                    uoCheckBoxListBrand.Items[2].Selected = list[0].IsCEL;
                    uoCheckBoxListBrand.Items[3].Selected = list[0].IsPUL;
                    uoCheckBoxListBrand.Items[4].Selected = list[0].IsSKS;
                }

                BindAirportListView();
                BindSeaportListView();
                BindVehicleTypeCapacityListView();
                BindContractVehicleDetailsList();
                BindContractHotelDetailsList();
                BindAttachmentListView();
            }
        }
Exemplo n.º 29
0
        private void BindContract()
        {
            ddlContract.Items.Clear();
            ContractBLL BLL = new ContractBLL();
            DataSet     ds  = BLL.GetList("SlnID=" + SlnID);

            if (ds.Tables[0].Rows.Count > 0)
            {
                ddlContract.DataSource     = ds;
                ddlContract.DataTextField  = "uname";
                ddlContract.DataValueField = "ID";
                ddlContract.DataBind();
                ddlContract.SelectedValue = ContractID.ToString();
                ddlContract_SelectedIndexChanged(null, null);
            }
        }
Exemplo n.º 30
0
        /// <summary>
        /// 合同续签
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult EntendContract(string id)
        {
            ViewBag.Classify = ListToSelect(SysDataDictService.GetContractClassify().Select(o => new SelectListItem()
            {
                Value = o.DicSN.ToString(), Text = o.Title
            }), emptyTitle: "请选择");
            //ViewBag.Suppliers = ListToSelect(SupplierService.GetList().Where(o => o.BusinessType == 1 && o.MasterState == 1).Select(o => new SelectListItem() { Value = o.Id, Text = o.Title }));

            var      obj         = new Logic.Entity.Contract();
            var      curr        = DateTime.Now;
            Contract oldContract = ContractBLL.FindById(id);

            oldContract.ToCopyProperty(obj);
            obj.Id          = CommonRules.GUID;
            obj.Version     = (short)(oldContract.Version + 1);
            ViewBag.Version = "续签 v" + obj.Version + ".0";
            if (obj.Version == 2)
            {
                obj.ContractSN = oldContract.ContractSN + "-" + obj.Version;
                //obj.PId = oldContract.Id;
            }

            if (obj.Version > 2)
            {
                string   st     = oldContract.ContractSN;
                string[] sArray = st.Split(new char[] { '-' });
                obj.ContractSN = sArray[0] + "-" + obj.Version;
                //obj.PId = oldContract.PId;
            }

            obj.PId         = id;
            obj.SigningDate = curr.ToString("yyyy-MM-dd");
            obj.CreateUID   = Sys.CurrentUser.UID;
            obj.CreateDT    = DateTime.Now;
            obj.StartDate   = DateTime.Parse(oldContract.EndDate).AddDays(1).ToString("yyyy-MM-dd");

            var      oldStartDate = DateTime.Parse(oldContract.StartDate);
            var      oldEndDate   = DateTime.Parse(oldContract.EndDate);
            TimeSpan ts           = oldEndDate - oldStartDate;
            var      duringDate   = ts.Days;

            obj.EndDate = DateTime.Parse(obj.StartDate).AddDays(duringDate).ToString("yyyy-MM-dd");

            obj.ContractBoths = oldContract.ContractBoths;

            return(View(obj));
        }