private void FillFranchisorData()
    {
        var currentSession = IoC.Resolve <ISessionContext>().UserSession;

        var Franchisoruser = OrganizationUser.GetFranchisorUser(currentSession);

        txtfname.Text      = Franchisoruser.User.FirstName;
        txtlname.Text      = Franchisoruser.User.LastName;
        txtMiddleName.Text = Franchisoruser.User.MiddleName;
        txtphonecell.Text  = Franchisoruser.User.PhoneCell;
        txtphonehome.Text  = Franchisoruser.User.PhoneHome;
        txtphoneother.Text = Franchisoruser.User.PhoneOffice;
        txtEmail1.Text     = Franchisoruser.User.EMail1;
        txtEmail2.Text     = Franchisoruser.User.EMail2;
        txtSSN.Text        = Franchisoruser.User.SSN;
        DateTime DOB = Convert.ToDateTime(Franchisoruser.User.DOB);

        txtDOB.Text            = DOB.ToString("MM/dd/yyyy");
        txtaddress1.Text       = Franchisoruser.Address.Address1;
        txtAddress2.Text       = Franchisoruser.Address.Address2;
        txtzip1.Text           = Franchisoruser.Address.Zip;
        hfCountryID.Value      = Franchisoruser.Address.CountryID.ToString();
        ddlState.SelectedValue = Franchisoruser.Address.StateID.ToString();
        txtCity.Text           = Franchisoruser.Address.City.ToString();
        txtabtmself.Text       = Franchisoruser.ShellDescription;
    }
Esempio n. 2
0
    private void FillData()
    {
        var currentSession = IoC.Resolve <ISessionContext>().UserSession;

        EFranchisorUser franchisoruser = OrganizationUser.GetFranchisorUser(currentSession);
        DataTable       dtPhoto        = new DataTable();

        dtPhoto.Columns.Add("Caption", typeof(String));
        dtPhoto.Columns.Add("Path", typeof(String));

        ISettings settings = IoC.Resolve <ISettings>();

        Int32 intMaxPicCount = settings.MaximumPictureCount;
        Int32 intCounter     = 0;

        foreach (string strOtherImagePath in franchisoruser.OtherPictures)
        {
            if (intCounter < intMaxPicCount)
            {
                dtPhoto.Rows.Add(new object[] { "", strOtherImagePath });
                intCounter++;
            }
        }
        grdphotoother.DataSource = dtPhoto;
        grdphotoother.DataBind();
    }
Esempio n. 3
0
    protected void btnupdatedown_Click(object sender, EventArgs e)
    {
        string strfolderpath = "/Images/TestUpload/";
        // Loop through each Image control
        var currentSession = IoC.Resolve <ISessionContext>().UserSession;

        EFranchisorUser franchisoruser = OrganizationUser.GetFranchisorUser(currentSession);

        string strtemp = string.Empty;

        strtemp = ucmyphoto.SaveImage(strfolderpath + "MyPic" + DateTime.Now.ToString("yyyyMMddhhmmss"));

        if (strtemp != string.Empty)
        {
            franchisoruser.MyPicture = "~/App" + strtemp;
        }

        strtemp = ucteamphoto.SaveImage(strfolderpath + "TeamPic" + DateTime.Now.ToString("yyyyMMddhhmmss"));
        if (strtemp != string.Empty)
        {
            franchisoruser.TeamPicture = "~/App" + strtemp;
        }

        ISettings settings       = IoC.Resolve <ISettings>();
        Int32     intMaxPicCount = settings.MaximumPictureCount;

        for (Int16 icount = 0; icount < intMaxPicCount; icount++)
        {
            UCCommon_ucphotopanel Ucphotopanel1 = (UCCommon_ucphotopanel)grdphotoother.Rows[icount].FindControl("Ucphotopanel1");
            strtemp = Ucphotopanel1.SaveImage(strfolderpath + icount + DateTime.Now.ToString("yyyyMMddhhmmss"));

            if (strtemp != string.Empty)
            {
                franchisoruser.OtherPictures[icount] = "~/App" + strtemp;
            }
        }


        Int64 returnresult;

        FranchisorDAL franchisorDal = new FranchisorDAL();

        returnresult = franchisorDal.SaveFranchisorUserImages(franchisoruser, Convert.ToInt32(EOperationMode.Update),
                                                              currentSession.UserId.ToString(), currentSession.CurrentOrganizationRole.OrganizationId.ToString(),
                                                              currentSession.CurrentOrganizationRole.RoleId.ToString());
        if (returnresult == 0)
        {
            returnresult = 9999991;
        }

        var listfranchisoruser = franchisorDal.GetFranchisorUser(currentSession.CurrentOrganizationRole.OrganizationId.ToString(), currentSession.UserId.ToString(), 1);

        if (listfranchisoruser != null && listfranchisoruser.Count > 0)
        {
            franchisoruser = listfranchisoruser[0];
        }

        System.Text.StringBuilder strJSCloseWindow = new System.Text.StringBuilder();
        strJSCloseWindow.Append(" <script language = 'Javascript'>window.close(); </script>");
        ClientScript.RegisterStartupScript(typeof(string), "JSCode", strJSCloseWindow.ToString());
    }