Example #1
0
 public AscmUserInfo(AscmUserInfo ascmUserInfo)
 {
     this.departmentId = ascmUserInfo.departmentId;
     //this.departmentPositionList = ascmUserInfo.departmentPositionList;
     this.description = ascmUserInfo.description;
     this.email = ascmUserInfo.email;
     this.employeeId = ascmUserInfo.employeeId;
     this.extExpandId = ascmUserInfo.extExpandId;
     this.extExpandType = ascmUserInfo.extExpandType;
     this.firstSpell = ascmUserInfo.firstSpell;
     this.id = ascmUserInfo.id;
     this.isAccountLocked = ascmUserInfo.isAccountLocked;
     this.lastLoginDate = ascmUserInfo.lastLoginDate;
     this.lastLoginIp = ascmUserInfo.lastLoginIp;
     this.mobilePhone = ascmUserInfo.mobilePhone;
     this.mobileTel = ascmUserInfo.mobileTel;
     this.officePhone = ascmUserInfo.officePhone;
     this.officeTel = ascmUserInfo.officeTel;
     this.organizationId = ascmUserInfo.organizationId;
     this.password = ascmUserInfo.password;
     this.roleId = ascmUserInfo.roleId;
     //this.roleList = ascmUserInfo.roleList;
     this.select = ascmUserInfo.select;
     this.sex = ascmUserInfo.sex;
     this.sign = ascmUserInfo.sign;
     this.siteAdmin = ascmUserInfo.siteAdmin;
     this.sortNo = ascmUserInfo.sortNo;
     this.spell = ascmUserInfo.spell;
     //this.supplierId = ascmUserInfo.supplierId;
     //this.supplierName = ascmUserInfo.supplierName;
     this.userId = ascmUserInfo.userId;
     this.userName = ascmUserInfo.userName;
     this.userName1 = ascmUserInfo.userName1;
     //this.userName2 = ascmUserInfo.userName2;
     //this.ynUnit = ascmUserInfo.ynUnit;
     this.logisticsClass = ascmUserInfo.logisticsClass;
 }
Example #2
0
 public AscmUserInfo(AscmUserInfo ascmUserInfo)
 {
     this.departmentId = ascmUserInfo.departmentId;
     //this.departmentPositionList = ascmUserInfo.departmentPositionList;
     this.description     = ascmUserInfo.description;
     this.email           = ascmUserInfo.email;
     this.employeeId      = ascmUserInfo.employeeId;
     this.extExpandId     = ascmUserInfo.extExpandId;
     this.extExpandType   = ascmUserInfo.extExpandType;
     this.firstSpell      = ascmUserInfo.firstSpell;
     this.id              = ascmUserInfo.id;
     this.isAccountLocked = ascmUserInfo.isAccountLocked;
     this.lastLoginDate   = ascmUserInfo.lastLoginDate;
     this.lastLoginIp     = ascmUserInfo.lastLoginIp;
     this.mobilePhone     = ascmUserInfo.mobilePhone;
     this.mobileTel       = ascmUserInfo.mobileTel;
     this.officePhone     = ascmUserInfo.officePhone;
     this.officeTel       = ascmUserInfo.officeTel;
     this.organizationId  = ascmUserInfo.organizationId;
     this.password        = ascmUserInfo.password;
     this.roleId          = ascmUserInfo.roleId;
     //this.roleList = ascmUserInfo.roleList;
     this.select    = ascmUserInfo.select;
     this.sex       = ascmUserInfo.sex;
     this.sign      = ascmUserInfo.sign;
     this.siteAdmin = ascmUserInfo.siteAdmin;
     this.sortNo    = ascmUserInfo.sortNo;
     this.spell     = ascmUserInfo.spell;
     //this.supplierId = ascmUserInfo.supplierId;
     //this.supplierName = ascmUserInfo.supplierName;
     this.userId    = ascmUserInfo.userId;
     this.userName  = ascmUserInfo.userName;
     this.userName1 = ascmUserInfo.userName1;
     //this.userName2 = ascmUserInfo.userName2;
     //this.ynUnit = ascmUserInfo.ynUnit;
     this.logisticsClass = ascmUserInfo.logisticsClass;
 }
Example #3
0
        public ContentResult SetLogisticsYnUserClass(string id, AscmUserInfo ascmUserInfo_Model)
        {
            JsonObjectResult jsonObjectResult = new JsonObjectResult();

            try
            {
                string userName = string.Empty;
                if (User.Identity.IsAuthenticated)
                {
                    userName = User.Identity.Name;
                }

                AscmUserInfo ascmUserInfo = null;
                if (!string.IsNullOrEmpty(id))
                {
                    ascmUserInfo = AscmUserInfoService.GetInstance().Get(id);
                    if (!string.IsNullOrEmpty(ascmUserInfo_Model.logisticsClass))
                        ascmUserInfo.logisticsClass = ascmUserInfo_Model.logisticsClass;

                    AscmUserInfoService.GetInstance().Update(ascmUserInfo);
                }

                jsonObjectResult.result = true;
                jsonObjectResult.message = "";
                jsonObjectResult.id = ascmUserInfo.userId;
                jsonObjectResult.entity = ascmUserInfo;
            }
            catch (Exception ex)
            {
                jsonObjectResult.result = false;
                jsonObjectResult.message = ex.Message;
            }

            string sReturn = JsonConvert.SerializeObject(jsonObjectResult);
            return Content(sReturn);
        }
Example #4
0
 public void Update(AscmUserInfo ascmUserInfo)
 {
     using (ITransaction tx = YnDaoHelper.GetInstance().nHibernateHelper.GetCurrentSession().BeginTransaction())
     {
         try
         {
             YnDaoHelper.GetInstance().nHibernateHelper.Update<AscmUserInfo>(ascmUserInfo);
             tx.Commit();//正确执行提交
         }
         catch (Exception ex)
         {
             tx.Rollback();//回滚
             YnBaseClass2.Helper.LogHelper.GetLog().Error("修改失败(Update AscmUserInfo)", ex);
             throw ex;
         }
     }
 }
Example #5
0
        public void SetSupplier(AscmUserInfo ascmUserInfo)
        {
            if (ascmUserInfo != null )
            {
                //string sql = "from AscmSupplier where id in (select numberValue from AscmAkWebUserSecAttrValues where attributeCode='" + MideaAscm.Dal.FromErp.Entities.AscmAkWebUserSecAttrValues.AttributeCodeDefine.supplierUser + "' and id=" + ascmUserInfo.extExpandId + ")";
                string sql = "from AscmSupplier where id in (select numberValue from AscmAkWebUserSecAttrValues where attributeCode='" + MideaAscm.Dal.FromErp.Entities.AscmAkWebUserSecAttrValues.AttributeCodeDefine.supplierUser + "' and webUserId=" + ascmUserInfo.extExpandId + ")";
                //sql = "from AscmEmployee where id in (" + sql + ")";
                IList<AscmSupplier> ilistAscmSupplier = YnDaoHelper.GetInstance().nHibernateHelper.Find<AscmSupplier>(sql);
                if (ilistAscmSupplier != null && ilistAscmSupplier.Count > 0)
                {
                    ascmUserInfo.ascmSupplier = ilistAscmSupplier[0];

                }
            }
        }
Example #6
0
        /// <summary>手持登录</summary>
        public AscmUserInfo MobileLogin(string userId, string userPwd, string connString, ref string errorMsg)
        {
            AscmUserInfo ascmUserInfo = null;
            errorMsg = string.Empty;
            using (Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(connString))
            {
                if (conn.State != System.Data.ConnectionState.Open)
                    conn.Open();

                Oracle.DataAccess.Client.OracleCommand cmd = new Oracle.DataAccess.Client.OracleCommand();
                cmd.Connection = conn;
                cmd.CommandText = "SELECT userId,userName,password,employeeId,extExpandType,extExpandId FROM ynUser WHERE extExpandId = :extExpandId";
                cmd.CommandType = System.Data.CommandType.Text;

                Oracle.DataAccess.Client.OracleParameter parm = new Oracle.DataAccess.Client.OracleParameter();
                parm.ParameterName = ":extExpandId";
                parm.OracleDbType = Oracle.DataAccess.Client.OracleDbType.NVarchar2;
                parm.Size = 20;
                parm.Value = userId;
                parm.Direction = System.Data.ParameterDirection.Input;
                cmd.Parameters.Add(parm);

                using (Oracle.DataAccess.Client.OracleDataReader reader = cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection))
                {
                    cmd.Parameters.Clear();

                    if (reader.Read())
                    {
                        ascmUserInfo = new AscmUserInfo();
                        ascmUserInfo.userId = reader["userId"].ToString();
                        ascmUserInfo.userName = reader["userName"].ToString();
                        ascmUserInfo.password = reader["password"].ToString();
                        int employeeId = 0;
                        int.TryParse(reader["employeeId"].ToString(), out employeeId);
                        ascmUserInfo.employeeId = employeeId;
                        ascmUserInfo.extExpandType = reader["extExpandType"].ToString();
                        ascmUserInfo.extExpandId = reader["extExpandId"].ToString();

                        if (ascmUserInfo.extExpandType == "erp")
                        {
                            byte[] result = Encoding.Default.GetBytes(userPwd);
                            System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
                            userPwd = BitConverter.ToString(md5.ComputeHash(result)).Replace("-", "");
                            if (ascmUserInfo.password != userPwd)
                            {
                                errorMsg = "密码不正确";
                            }
                            else if (!string.IsNullOrEmpty(ascmUserInfo.userName))
                            {
                                Oracle.DataAccess.Client.OracleCommand cmd2 = new Oracle.DataAccess.Client.OracleCommand();
                                cmd2.Connection = conn;
                                cmd2.CommandText = "SELECT id,name FROM ascm_supplier WHERE docNumber = :docNumber";
                                cmd2.CommandType = System.Data.CommandType.Text;
                                cmd2.Parameters.Add(new Oracle.DataAccess.Client.OracleParameter {
                                    ParameterName = ":docNumber",
                                    OracleDbType = Oracle.DataAccess.Client.OracleDbType.NVarchar2,
                                    Size = 20,
                                    Value = ascmUserInfo.userName,
                                    Direction = System.Data.ParameterDirection.Input
                                });

                                using (Oracle.DataAccess.Client.OracleDataReader reader2 = cmd2.ExecuteReader(System.Data.CommandBehavior.CloseConnection))
                                {
                                    cmd2.Parameters.Clear();
                                    if (reader2.Read())
                                    {
                                        int id = 0;
                                        if (int.TryParse(reader2["id"].ToString(), out id))
                                        {
                                            AscmSupplier ascmSupplier = new AscmSupplier();
                                            ascmSupplier.id = id;
                                            ascmSupplier.name = reader2["name"].ToString();
                                            ascmUserInfo.ascmSupplier = ascmSupplier;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return ascmUserInfo;
        }