Exemplo n.º 1
0
        protected override void FaceToData(ref CustomerAgreement model)
        {
            model.ModifyTime = DateTime.Now;

            if (!this.IsEdit)
            {
                model.CreateUser = this.CurrentOperatorUser;
            }

            model.Subject = this.SubjectID.Text;
            model.Content = this.ContentID.Text;
            var userService = WebCrm.Framework.DependencyResolver.Resolver <ICustomerService>();

            if (this.CustomerID.SelectedValue.IsInt())
            {
                model.Customer = userService.FindById(int.Parse(this.CustomerID.SelectedValue));
            }

            if (this.ExpireID.Text.IsDateTime())
            {
                model.Expire = DateTime.Parse(this.ExpireID.Text);
            }

            model.AgreementType = AspNetHelper.GetItemByDropDownValue(this.AgreementTypeID);
            model.Remark        = this.RemarkID.Text;
            model.FileIds       = model.FileIds + "," + Request.GetRequestValue("fileID").Trim(',');
        }
Exemplo n.º 2
0
        protected override void FaceToData(ref Task model)
        {
            model.ModifyTime = DateTime.Now;

            if (!this.IsEdit)
            {
                model.CreateUser = this.CurrentOperatorUser;
            }

            model.Subject     = this.SubjectID.Text;
            model.TaskContent = this.TaskContentID.Text;
            var userService = WebCrm.Framework.DependencyResolver.Resolver <IUserInfoService>();

            if (this.AssignUserID.SelectedValue.IsInt())
            {
                model.AssignUser = userService.FindById(int.Parse(this.AssignUserID.SelectedValue));
            }

            if (this.ActualDateID.Text.IsDateTime())
            {
                model.ActualDate = DateTime.Parse(this.ActualDateID.Text);
            }
            if (this.StartDateID.Text.IsDateTime())
            {
                model.StartDate = DateTime.Parse(this.StartDateID.Text);
            }
            if (this.ExpectationDateID.Text.IsDateTime())
            {
                model.ExpectationDate = DateTime.Parse(ExpectationDateID.Text);
            }

            model.ExecutionContent = this.ExecutionContentID.Text;
            model.TaskProcess      = AspNetHelper.GetItemByDropDownValue(this.TaskProcessID);
            model.Remark           = this.RemarkID.Text;
        }
Exemplo n.º 3
0
        protected override void FaceToData(ref Financial model)
        {
            model.ModifyTime = DateTime.Now;

            model.Name          = this.NameID.Text;
            model.State         = StateId.SelectedValue == "1";
            model.CustomerName  = this.CustomerNameID.Text;
            model.FinancialDate = DateTime.Parse(this.FinancialDateID.Text);

            model.FinancialType = this.IsPay ? WebCrm.Model.FinancialType.Pay : WebCrm.Model.FinancialType.Receive;

            model.ChargePerson =
                DependencyResolver.Resolver <IUserInfoService>().FindById(int.Parse(ChargePersonID.SelectedValue));


            if (model.FinancialType == WebCrm.Model.FinancialType.Receive)
            {
                model.Customer =
                    DependencyResolver.Resolver <ICustomerService>().FindById(int.Parse(this.CustomerID.SelectedValue));

                if (model.Customer != null)
                {
                    model.CustomerName = this.CustomerNameID.Text;
                }
            }
            else
            {
                model.Cooperation =
                    DependencyResolver.Resolver <ICooperationService>().FindById(int.Parse(this.CustomerID.SelectedValue));


                if (model.Cooperation != null)
                {
                    model.CustomerName = this.CustomerNameID.Text;
                }
            }

            model.SumPrice    = decimal.Parse(this.SumPriceID.Text);
            model.TreatResult = this.TreatResultID.Text;
            model.Remark      = this.RemarkID.Text;
            if (!this.IsEdit)
            {
                model.Company = this.CurrentCompany;
            }
            model.FiledIds = model.FiledIds + "," + Request.GetRequestValue("fileID").Trim(',');
            if (this.IsPay)
            {
                model.FinancialPayType = AspNetHelper.GetItemByDropDownValue(this.FinancialPayTypeID);
            }
        }
Exemplo n.º 4
0
        protected override void FaceToData(ref Template model)
        {
            model.ModifyTime = DateTime.Now;

            model.TemplateName = this.TemplateNameID.Text;
            model.TemplateCode = this.TemplateCodeID.Text;
            model.MsgContent   = this.MsgContentID.Text;
            model.MsgType      = AspNetHelper.GetItemByDropDownValue(this.MsgTypeID);
            if (!this.IsEdit)
            {
                model.CreatePerson = this.CurrentOperatorUser;
                model.Company      = this.CurrentCompany;
            }
        }
Exemplo n.º 5
0
        private void FaceToData(ref Advertising value)
        {
            value.Name         = this.NameID.Text;
            value.Content      = this.ContentID.Text;
            value.Remark       = this.RemarkID.Text;
            value.Free         = decimal.Parse(this.FreeID.Text);
            value.DeliveryDate = DateTime.Parse(this.DeliveryDateID.Text);
            value.WorkName     = this.DropWorkNameID.Text;

            value.State    = AspNetHelper.GetItemByDropDownValue(this.StateID);
            value.Evaluate = AspNetHelper.GetItemByDropDownValue(this.EvaluateID);
            value.Channel  = AspNetHelper.GetItemByDropDownValue(this.ChannelID);
            value.Company  = this.CurrentCompany;
            value.FiledIds = value.FiledIds + "," + Request.GetRequestValue("fileID").Trim(',');
        }
Exemplo n.º 6
0
        protected override void FaceToData(ref Contract model)
        {
            model.ModifyTime = DateTime.Now;

            model.ContractName = this.ContractNameID.Text;
            model.State        = AspNetHelper.GetItemByDropDownValue(this.StateId);

            if (CustomerID.SelectedValue.IsInt())
            {
                model.Customer =
                    DependencyResolver.Resolver <ICustomerService>().FindById(
                        int.Parse(this.CustomerID.SelectedValue));
            }

            if (model.Customer != null)
            {
                model.CustomerName = model.Customer.ShortName;
            }
            else
            {
                model.CustomerName = CustomerNameID.Text;
            }

            model.ContractName = this.CodeID.Text;
            model.StartDate    = DateTime.Parse(this.StartDateID.Text);
            model.EndDate      = DateTime.Parse(this.EndDateID.Text);


            model.SignPerson =
                DependencyResolver.Resolver <IUserInfoService>().FindById(int.Parse(SignPersonID.SelectedValue));

            model.CustomerSignPerson = this.CustomerSignPersonID.Text;
            model.SignDate           = DateTime.Parse(this.SignDateID.Text);

            model.SignAddress = this.SignAddressID.Text;
            model.StorePlace  = this.StorePlaceID.Text;
            model.Sum         = decimal.Parse(this.SumID.Text);

            model.SettleState = this.SettleStateID.SelectedValue.Convert <SettleState>();
            model.Remark      = this.RemarkID.Text;
            model.Content     = this.ContentID.Text;

            model.Company = this.CurrentCompany;


            model.FiledIds = model.FiledIds + "," + Request.GetRequestValue("fileID").Trim(',');
        }
Exemplo n.º 7
0
 private void FaceToData(ref CompanyAction value)
 {
     value.Name       = this.NameID.Text;
     value.Content    = this.ContentID.Text;
     value.Remark     = this.RemarkID.Text;
     value.Free       = decimal.Parse(this.FreeID.Text);
     value.ActionDate = DateTime.Parse(this.ActionDateID.Text);
     if (this.DropWorkNameID.SelectedValue.IsInt())
     {
         value.WorkName = DependencyResolver.Resolver <ICooperationService>().FindById(int.Parse(this.DropWorkNameID.SelectedValue));
     }
     value.State    = AspNetHelper.GetItemByDropDownValue(this.StateID);
     value.Evaluate = AspNetHelper.GetItemByDropDownValue(this.EvaluateID);
     value.FiledIds = value.FiledIds + "," + Request.GetRequestValue("fileID").Trim(',');
     if (value.Company != null)
     {
         value.Company = this.CurrentCompany;
     }
 }
Exemplo n.º 8
0
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="customer"></param>
        private void FaceToData(ref Customer customer)
        {
            if (customer == null)
            {
                return;
            }
            customer.Name      = this.NameId.Text;
            customer.ShortName = this.ShortName.Text;
            customer.Cagegory  = FindCategoryItem(this.CagegoryTypeId.SelectedValue);

            customer.Car          = this.CarId.Text;
            customer.Code         = this.Code.Text;
            customer.CreditRating = FindCategoryItem(CreditRatingID.SelectedValue);
            customer.CustomerType = this.FindCategoryItem(this.CustomerTypeItemId.SelectedValue);
            customer.AccType      = this.IdentificationID.SelectedValue == "1"
                                          ? CustomerIdentification.Enterprise
                                          : CustomerIdentification.Person;
            customer.Area    = this.FindCategoryItem(this.AreaId.SelectedValue);
            customer.Company = this.CurrentCompany;
            customer.Remark  = this.RemarkID.Text;

            customer.CreatePerson = this.CurrentOperatorUser;

            customer.ImportantLevel = this.ImportantLevelId.SelectedValue.Convert <ImportantLevel>();
            customer.LevelSort      = this.FindCategoryItem(this.LevelSort.SelectedValue);

            customer.RelationLevel = this.FindCategoryItem(this.RelationLevelID.SelectedValue);
            if (this.BelongPersonID.SelectedValue.IsInt())
            {
                customer.BelongPerson =
                    DependencyResolver.Resolver <IUserInfoService>().FindById(int.Parse(this.BelongPersonID.SelectedValue));
            }
            customer.ModifyTime = DateTime.Now;
            customer.MemberCard =
                DependencyResolver.Resolver <IMembershipCardService>().FindByCode(this.MemberCardID.Text);
            customer.CustomerBusiness = AspNetHelper.GetItemByDropDownValue(this.CustomerBusinessID);
            customer.CustomerSource   = AspNetHelper.GetItemByDropDownValue(this.CustomerSourceID);
        }
Exemplo n.º 9
0
        protected override void FaceToData(ref Suggest model)
        {
            model.ModifyTime = DateTime.Now;

            model.CustoMerName      = this.CustomerNameID.Text;
            model.SuggestDate       = DateTime.Parse(this.SuggestDateID.Text);
            model.SolveDate         = DateTime.Parse(this.SolveDateID.Text);
            model.SuggestComplaints = this.IsPay ? WebCrm.Model.SuggestComplaints.Complaints : WebCrm.Model.SuggestComplaints.Suggest;

            model.CustoMerName = this.CustomerNameID.Text;
            if (this.CustomerID.SelectedValue.IsInt())
            {
                model.Customer =
                    DependencyResolver.Resolver <ICustomerService>().FindById(
                        int.Parse(this.CustomerID.SelectedValue));
            }
            model.Content      = this.ContentID.Text;
            model.SolveResults = this.SolveResultsID.Text;
            model.SolveType    = AspNetHelper.GetItemByDropDownValue(this.SolveTypeID);
            model.SuggestType  = AspNetHelper.GetItemByDropDownValue(this.SuggestTypeID);
            if (!this.IsEdit)
            {
                model.Company = this.CurrentCompany;
            }

            model.FileIds = model.FileIds + "," + Request.GetRequestValue("fileID").Trim(',');
            var userService = DependencyResolver.Resolver <IUserInfoService>();

            if (HandlerPersonID.SelectedValue.IsInt())
            {
                model.HandlerPerson = userService.FindById(int.Parse(this.HandlerPersonID.SelectedValue));
            }
            if (this.DealPersonID.SelectedValue.IsInt())
            {
                model.DealPerson = userService.FindById(int.Parse(this.DealPersonID.SelectedValue));
            }
        }
Exemplo n.º 10
0
        protected override void FaceToData(ref CustormerConsumRecord record)
        {
            if (this.CustomerID.Text.IsInt())
            {
                record.Customer = this.CustomerService.FindById(int.Parse(this.CustomerID.Text));
            }
            record.ConsumptionDate = DateTime.Parse(VisitDateID.Text);
            record.SpendTotal      = int.Parse(SpendTotalID.Text);
            if (DiscountType.SelectedValue.IsInt())
            {
                record.DiscountType = this.CategoryItemService.FindById(int.Parse(this.DiscountType.SelectedValue));
            }
            record.AfterDiscountFree = decimal.Parse(AfterDiscountFree.Text);
            if (ScoreRuleID.SelectedValue.IsInt())
            {
                record.ScoreRule = this.CategoryItemService.FindById(int.Parse(this.ScoreRuleID.SelectedValue));
            }
            if (ScoreID.Text.IsInt())
            {
                record.Score = int.Parse(ScoreID.Text);
            }
            record.ReceiveMoney = decimal.Parse(ReceiveMoneyID.Text);
            record.WritePerson  = this.CurrentOperatorUser;
            record.Company      = this.CurrentCompany;

            record.Remark               = RemarkID.Text;
            record.ConsumerDetails      = ConsumerDetailsID.Text;
            record.ModifyTime           = DateTime.Now;
            record.ConsumerBusinessType = AspNetHelper.GetItemByDropDownValue(ConsumerBusinessType);
            record.FiledIds             = record.FiledIds + "," + Request.GetRequestValue("fileID").Trim(',');
            if (BussinessPersonID.SelectedValue.IsInt())
            {
                record.BussinessPerson =
                    DependencyResolver.Resolver <IUserInfoService>().FindById(int.Parse(BussinessPersonID.SelectedValue));
            }
        }