Exemple #1
0
        public bool Create()
        {
            // Check Html Info
            string CustomerName       = txt_CustomerName.Text;
            string CustomerTel        = txt_CustomerTel.Text;
            string CustomerFax        = txt_CustomerFax.Text;
            string CustomerEmail      = txt_CustomerEmail.Text;
            string CustomerAddress    = txt_CustomerAddress.Text;
            string CustomerUser       = txt_CustomerUser.Text;
            string CustomerUserMobile = txt_CustomerUserMobile.Text;

            int Resualt = MPB.Create_Customer(CustomerName, CustomerTel, CustomerFax, CustomerEmail, CustomerAddress
                                              , CustomerUser, CustomerUserMobile);

            if (Resualt != 0)
            {
                string UserPass = CommonBusiness.RandomString(10, true);
                // Adobe ساختن کاربر در
                string DomainAddress      = "kadobe.iauec.ac.ir";
                string DomainLogin        = "******";
                string DomainPassword     = "******";
                Cookie DomainCookies      = MPB.Adobe_Login(DomainAddress, DomainLogin, DomainPassword);
                string DomainCookiesValue = DomainCookies.Value;

                MPB.Adobe_Create_User(DomainAddress, CustomerName, "Admin", "customer" + Resualt.ToString()
                                      , UserPass, DomainCookiesValue);

                // بروز رسانی در جدول مشتری
                MPB.Update_Customers_ById(1, Resualt, "customer" + Resualt.ToString(), UserPass, 0, "");

                // نمایش در صفحه
                lbl_UserAdobe.Text = "نام کاربری این مشتری در آدابی: " + "customer" + Resualt.ToString();
                lbl_UserPass.Text  = "کلمه عبور این مشتری در آدابی: " + UserPass;

                CustomerInfo.Visible = true;

                return(true);
            }

            return(false);
        }
Exemple #2
0
        public void AddUserinMeeting()
        {
            string UserPassWord = CommonBusiness.RandomString(10, true);
            // ایجاد کاربر
            int CustomerUserId = MPB.Create_Customers_Users(txt_Name.Text, txt_Family.Text, txt_LatinName.Text
                                                            , txt_LatinFamily.Text, txt_Mobile.Text, txt_Email.Text, txt_UserName.Text, txt_NationalCode.Text
                                                            , int.Parse(ddl_Sex.SelectedValue), 3, ddl_Access.SelectedValue, "-", txt_IdNumber.Text
                                                            , UserPassWord);

            DataTable DTMeetingOfClass = MPB.Get_Customers_Meeting_ByClassId(int.Parse(lbl_ClassId.Text));

            string UserAccess = ""; // دسترسی کاربر

            if (ddl_Access.SelectedValue == "1")
            {
                UserAccess = "host";
            }
            else
            {
                UserAccess = "view";
            }

            // اضافه کردن کاربر به درون کلاس ها
            for (int i = 0; i < DTMeetingOfClass.Rows.Count; i++)
            {
                MPB.Create_Customers_UserMeeting(CustomerUserId
                                                 , int.Parse(DTMeetingOfClass.Rows[i]["Id"].ToString())
                                                 , UserAccess);
            }


            // چک کردن کاربر در آدابی
            DataTable DTAdobeUser        = MPB.Adobe_Get_PRINCIPALS_ByLOGIN("user" + CustomerUserId.ToString());
            string    DomainCookiesValue = MPB.Adobe_Login().Value;
            string    DomainAddress      = "kadobe.iauec.ac.ir";

            ////  اضافه کردن کاربر به آدابی
            if (DTAdobeUser.Rows.Count == 0)
            {
                MPB.Adobe_Create_User(DomainAddress, txt_Name.Text, txt_Family.Text
                                      , "user" + CustomerUserId.ToString(), UserPassWord, DomainCookiesValue);
            }

            string CustomerPrincipalsId = DTAdobeUser.Rows[0]["PRINCIPAL_ID"].ToString();

            //// اضافه کردن کاربر به درون کلاس در آداب
            //for (int j = 0; j < DTMeetingOfClass.Rows.Count; j++)
            //{
            //    //GetMeetingInfo_ByMeetingName
            //    string CustomerMeetingScoId=MPB.Adobe_Get_SP_Get_ScosByName()

            //    MPB.Adobe_Insert_UserInMeeting(DomainAddress
            //    , CustomerPrincipalsId
            //    , CustomerMeetingScoId[i]
            //    , UserAccess
            //    , DomainCookiesValue);


            //}



            //بازگشت به صفحه ویرایش کاربر
            // + کدکلاس نیز ارسال شود تا در آن صفحه، اطلاعات همین کلاسی که تغییر کرده کاربرش نمایش داده شود
        }