コード例 #1
0
        public SysPreDefineValue SetToBussinessObjectPreDefineValue(Sys_PreDefineValue Entity)
        {
            SysPreDefineValue Model = new SysPreDefineValue();

            Model.PreDefineValueID = Entity.PreDefineValueID;
            //Model.PreDefineValueForID = Entity.PreDefineValueForID;
            //Model.Address = Entity.Address;
            //Model.ContactPerson = Entity.ContactPerson;
            //Model.ContactNumber = Entity.ContactNumber;
            //Model.EmailAddress = Entity.EmailAddress;
            //Model.FaxNo = Entity.FaxNo;
            //Model.PhoneNo = Entity.PhoneNo;
            //Model.SkypeID = Entity.SkypeID;
            Model.IsActive = Entity.IsActive == true ? "Active" : "Inactive";

            return(Model);
        }
コード例 #2
0
        public SysPreDefineValue SetToBussinessObject(Sys_PreDefineValue Entity)
        {
            SysPreDefineValue Model = new SysPreDefineValue();

            Model.PreDefineValueID      = Entity.PreDefineValueID;
            Model.PreDefineValueForID   = Entity.PreDefineValueForID;
            Model.PreDefineValueTitle   = Entity.PreDefineValueTitle;
            Model.PreDefineValueContent = Entity.PreDefineValueContent;
            if (Entity.PreDefineValueGroup == "1")
            {
                Model.PreDefineValueGroup = "Identity No";
            }
            else if (Entity.PreDefineValueGroup == "2")
            {
                Model.PreDefineValueGroup = "CC";
            }
            else if (Entity.PreDefineValueGroup == "3")
            {
                Model.PreDefineValueGroup = "Letter Signature";
            }
            else
            {
                Model.PreDefineValueGroup = "";
            }
            if (Entity.PreDefineValueIncreaseBy == "Y")
            {
                Model.PreDefineValueIncreaseBy = "Yearly";
            }
            else if (Entity.PreDefineValueIncreaseBy == "M")
            {
                Model.PreDefineValueIncreaseBy = "Monthly";
            }
            else if (Entity.PreDefineValueIncreaseBy == "D")
            {
                Model.PreDefineValueIncreaseBy = "Daily";
            }
            else if (Entity.PreDefineValueIncreaseBy == "R")
            {
                Model.PreDefineValueIncreaseBy = "Respectively";
            }
            else if (Entity.PreDefineValueIncreaseBy == "Y")
            {
                Model.PreDefineValueIncreaseBy = "Yearly";
            }
            else if (Entity.PreDefineValueIncreaseBy == "FD")
            {
                Model.PreDefineValueIncreaseBy = "Yearly";
            }
            else
            {
                Model.PreDefineValueIncreaseBy = "";
            }
            Model.MaxValue             = Entity.MaxValue;
            Model.InternalMailAddress  = Entity.InternalMailAddress;
            Model.InternalMailAutoSend = string.IsNullOrEmpty(Entity.InternalMailAutoSend) ? "" : Entity.InternalMailAutoSend;
            Model.ExternalMailAddress  = Entity.ExternalMailAddress;
            Model.ExternalMailAutoSend = string.IsNullOrEmpty(Entity.ExternalMailAutoSend) ? "" : Entity.ExternalMailAutoSend;
            Model.Remarks  = Entity.Remarks;
            Model.IsActive = Entity.IsActive == true ? "Active" : "Inactive";

            return(Model);
        }
コード例 #3
0
        public Sys_PreDefineValue SetToModelObject(SysPreDefineValue model, int userid)
        {
            Sys_PreDefineValue Entity = new Sys_PreDefineValue();

            Entity.PreDefineValueID      = model.PreDefineValueID;
            Entity.PreDefineValueForID   = model.PreDefineValueForID;
            Entity.PreDefineValueTitle   = model.PreDefineValueTitle;
            Entity.PreDefineValueContent = model.PreDefineValueContent;
            switch (model.PreDefineValueGroup)
            {
            case "Identity No":
                Entity.PreDefineValueGroup = "1";
                if (model.PreDefineValueIncreaseBy == "Yearly")
                {
                    Entity.PreDefineValueIncreaseBy = "Y";
                    Entity.MaxValue = model.PreDefineValueContent + DateTime.Now.Year.ToString().Substring(DateTime.Now.Year.ToString().Length - 2) + "00" + "00" + "0000";
                }
                else if (model.PreDefineValueIncreaseBy == "Monthly")
                {
                    Entity.PreDefineValueIncreaseBy = "M";
                    Entity.MaxValue = model.PreDefineValueContent + DateTime.Now.Year.ToString().Substring(DateTime.Now.Year.ToString().Length - 2) + DateTime.Now.Month.ToString("d2") + "00" + "0000";
                }
                else if (model.PreDefineValueIncreaseBy == "Daily")
                {
                    Entity.PreDefineValueIncreaseBy = "D";
                    Entity.MaxValue = model.PreDefineValueContent + DateTime.Now.Year.ToString().Substring(DateTime.Now.Year.ToString().Length - 2) + DateTime.Now.Month.ToString("d2") + DateTime.Now.Day.ToString("d2") + "0000";
                }
                else if (model.PreDefineValueIncreaseBy == "Respectively")
                {
                    Entity.PreDefineValueIncreaseBy = "R";
                    Entity.MaxValue = model.PreDefineValueContent + "R0000";
                }
                else if (model.PreDefineValueIncreaseBy == "Four Digits")
                {
                    Entity.PreDefineValueIncreaseBy = "FD";
                    Entity.MaxValue = model.PreDefineValueContent + "0000";
                }
                else
                {
                    Entity.MaxValue = string.Empty;
                    Entity.PreDefineValueIncreaseBy = string.Empty;
                }
                break;

            case "CC":
                Entity.PreDefineValueGroup      = "2";
                Entity.MaxValue                 = string.Empty;
                Entity.PreDefineValueIncreaseBy = string.Empty;
                break;

            case "Letter Signature":
                Entity.PreDefineValueGroup      = "3";
                Entity.MaxValue                 = string.Empty;
                Entity.PreDefineValueIncreaseBy = string.Empty;
                break;

            default:
                Entity.PreDefineValueGroup = string.Empty;
                break;
            }

            Entity.InternalMailAddress  = string.IsNullOrEmpty(model.InternalMailAddress) ? string.Empty : model.InternalMailAddress;
            Entity.InternalMailAutoSend = string.IsNullOrEmpty(model.InternalMailAutoSend) ? string.Empty : model.InternalMailAutoSend;
            Entity.ExternalMailAddress  = string.IsNullOrEmpty(model.ExternalMailAddress) ? string.Empty : model.ExternalMailAddress;
            Entity.ExternalMailAutoSend = string.IsNullOrEmpty(model.ExternalMailAutoSend) ? string.Empty : model.ExternalMailAutoSend;
            Entity.Remarks   = string.IsNullOrEmpty(model.Remarks) ? string.Empty : model.Remarks;
            Entity.IsActive  = model.IsActive == "Active";
            Entity.SetOn     = DateTime.Now;
            Entity.SetBy     = userid;
            Entity.IPAddress = string.Empty;
            return(Entity);
        }