public RTN_SAVE_DATA MemberModify(T_MEMBER Param, T_STORE Param2)
        {
            RTN_SAVE_DATA rtn = new RTN_SAVE_DATA();

            try
            {
                using (TransactionScope tran = new TransactionScope())
                {
                    if (Param.SHARE_AUTH_NUMBER.ToString("").Length != 2)
                    {
                        Param.SHARE_AUTH_NUMBER = "00";
                    }


                    string sql = Global.DBAgent.LoadSQL(sqlBasePath + "BizService\\Member\\T_MEMBER.xml", "MemberSave"
                                                        , Param.MEMBER_CODE.ToString("-1")
                                                        , Param.USER_TYPE.ToString("5")
                                                        , Param.USER_ID.ToString("")
                                                        , Param.PASSWORD.ToString("")
                                                        , Param.USER_NAME.ToString("")
                                                        , Param.EMAIL.ToString("")
                                                        , Param.PHONE.ToString("")
                                                        , Param.MOBILE.ToString("")
                                                        , Param.ADDRESS1.ToString("")
                                                        , Param.ADDRESS2.ToString("")
                                                        , Param.ZIP_CODE.ToString("")
                                                        , Param.BIRTH.ToString("")
                                                        , Param.GENDER.ToString("1")
                                                        , Param.REMARK.ToString("")
                                                        , Param.PASSWORD_CHANGE_URL.ToString("")
                                                        , Param.SHARE_AUTH_NUMBER.ToString("")
                                                        , Convert.ToDateTime(Param.PASSWORD_AUTH_TIME.ToString("1901-01-01")).ToString("yyyy-MM-dd HH:mm:ss.fff")
                                                        , Param.HIDE == true ? "1" : "0"
                                                        , Param.INSERT_CODE.ToString()     /*Admin*/
                                                        );
                    var rtn2 = db.ExecuteQuery <int>(sql);
                    rtn.DATA = Convert.ToString(rtn2.First());


                    sql = Global.DBAgent.LoadSQL(sqlBasePath + "BizService\\Member\\T_MEMBER_EMPLOYEE.xml", "MemberModifySave"

                                                 , Param2.COMPANY_CODE.ToString("")
                                                 , Param2.STORE_CODE.ToString("")
                                                 , Param2.COMPANY_TYPE2.ToString("7")
                                                 , Param2.BUSI_REG_NUMBER.ToString("")
                                                 , Param.INSERT_CODE.ToString()
                                                 );

                    db.ExecuteCommand(sql);
                    tran.Complete();
                }
            }
            catch (Exception ex)
            {
                rtn.ERROR_MESSAGE = ex.Message;
            }

            return(rtn);
        }
Ejemplo n.º 2
0
        public JsonResult MemberModifySave(T_MEMBER Param, T_STORE Param2)
        {
            if (Param2 == null || Param2.STORE_CODE == null)
            {
                Param2 = new T_STORE {
                    COMPANY_TYPE2     = SessionHelper.LoginInfo.STORE.COMPANY_TYPE2
                    , BUSI_REG_NUMBER = ""
                }
            }
            ;

            Param2.COMPANY_CODE = Param2.COMPANY_CODE;
            Param2.STORE_CODE   = Param2.STORE_CODE;

            string msg = string.Empty;

            //Param.PASSWORD = GlobalMvc.Util.Encrypt_PW(Param.PASSWORD);
            Param.BIRTH = Param.BIRTH.RemoveDateString();

            T_MEMBER memData = new AccountService().GetMemberList(new T_MEMBER_COND {
                USER_ID = Param.USER_ID
            }).FirstOrDefault();
            RTN_SAVE_DATA data = new RTN_SAVE_DATA();

            if (Param.PASSWORD != "******")
            {
                if (!string.IsNullOrEmpty(Param.PASSWORD))
                {
                    memData.PASSWORD = GlobalMvc.Util.Encrypt_PW(Param.PASSWORD);
                }
            }
            memData.BIRTH       = Param.BIRTH;
            memData.USER_NAME   = Param.USER_NAME;
            memData.ZIP_CODE    = Param.ZIP_CODE;
            memData.ADDRESS1    = Param.ADDRESS1;
            memData.ADDRESS2    = Param.ADDRESS2;
            memData.PHONE       = Param.PHONE;
            memData.GENDER      = Param.GENDER;
            memData.INSERT_CODE = (int)(SessionHelper.LoginInfo.MEMBER == null ? 0 : SessionHelper.LoginInfo.MEMBER.MEMBER_CODE);
            ///memData.MEMBER_CODE = (int)(SessionHelper.LoginInfo.MEMBER == null ? 0 : SessionHelper.LoginInfo.MEMBER.MEMBER_CODE);


            data = new AccountService().MemberModify(memData, Param2);

            data.RETURN_URL = "/";

            memData = new AccountService().GetMemberList(new T_MEMBER_COND {
                USER_ID = Param.USER_ID
            }).FirstOrDefault();
            // SessionHelper.LoginInfo.STORE = new ALT.BizService.BasicService().GetStoreList(new T_STORE_COND { STORE_CODE = SessionHelper.LoginInfo.EMPLOYEE.STORE_CODE }).First();
            // SessionHelper.LoginInfo.MEMBER = memData;

            return(new JsonResult {
                Data = data
            });
        }
Ejemplo n.º 3
0
        public JsonResult StoreSave(T_STORE Param)
        {
            Param.INSERT_CODE = SessionHelper.LoginInfo.MEMBER.MEMBER_CODE;
            RTN_SAVE_DATA rtn = new BasicService().StoreSave(Param);

            return(new JsonResult()
            {
                Data = rtn
            });
        }
Ejemplo n.º 4
0
        public RTN_SAVE_DATA StoreSave(T_STORE Param)
        {
            RTN_SAVE_DATA rtnData = new RTN_SAVE_DATA()
            {
            };

            try
            {
                if (!(string.IsNullOrEmpty(Param.PASSWORD) || Param.PASSWORD == "******"))
                {
                    Param.PASSWORD = GlobalMvc.Util.Encrypt_PW(Param.PASSWORD);
                }

                using (TransactionScope tran = new TransactionScope())
                {
                    if (Param.SAVE_TYPE != "D")
                    {
                        string sql = Global.DBAgent.LoadSQL(sqlBasePath + "BizService\\Basic\\T_STORE.xml", "StoreSave"
                                                            , Param.STORE_CODE.ToString("-1")
                                                            , Param.COMPANY_CODE.ToString("")
                                                            , Param.STORE_ID.ToString("")
                                                            , Param.PASSWORD.ToString("")
                                                            , Param.STORE_NAME.ToString("")
                                                            , Param.STORE_TYPE.ToString("")
                                                            , Param.PHONE.ToString("")
                                                            , Param.MOBILE.ToString("")
                                                            , Param.EMAIL.ToString("")
                                                            , Param.ADDRESS1.ToString("")
                                                            , Param.ADDRESS2.ToString("")
                                                            , Param.ZIP_CODE.ToString("")
                                                            , Param.LATITUDE.ToString("")
                                                            , Param.LONGITUDE.ToString("")
                                                            , Param.OWNER_NAME.ToString("")
                                                            , Param.OWNER_PHONE.ToString("")
                                                            , Param.OWNER_MOBILE.ToString("")
                                                            , Param.OWNER_EMAIL.ToString("")
                                                            , Param.STATUS.ToString("9")
                                                            , Param.CULTURE_NAME.ToString("")
                                                            , Param.THEME_NAME.ToString("")
                                                            , Param.TIME_ZONE.ToString("9")
                                                            , Param.BUSI_REG_NUMBER.ToString("")
                                                            , Param.REMARK.ToString("")
                                                            , Param.INSERT_CODE
                                                            );
                        rtnData = db.ExecuteQuery <RTN_SAVE_DATA>(sql).First();
                    }
                    else
                    {
                        string sql = Global.DBAgent.LoadSQL(sqlBasePath + "BizService\\Basic\\T_STORE.xml", "StoreDelete"
                                                            , Param.STORE_CODE.ToString("-1")
                                                            , Param.INSERT_CODE
                                                            );
                        rtnData = db.ExecuteQuery <RTN_SAVE_DATA>(sql).First();
                    }

                    if (!string.IsNullOrEmpty(rtnData.ERROR_MESSAGE))
                    {
                        throw new Exception(rtnData.ERROR_MESSAGE);
                    }

                    tran.Complete();
                }
            }
            catch (Exception ex)
            {
                rtnData.ERROR_MESSAGE = ex.Message;
            }
            return(rtnData);
        }