Esempio n. 1
0
        public ActionResult AjaxGenralSetings(GenralSetingModel objModel)
        {
            objResponse       Response         = new objResponse();
            GenralSetingModel objSetings       = new GenralSetingModel();
            GenralSeting      objGenralSetings = new GenralSeting();

            session = new SessionHelper();
            try
            {
                objGenralSetings.Company     = objModel.Company;
                objGenralSetings.Address     = objModel.Address;
                objGenralSetings.City        = objModel.City;
                objGenralSetings.Stete       = objModel.Stete;
                objGenralSetings.Country     = objModel.Country;
                objGenralSetings.Zipcode     = objModel.Zipcode;
                objGenralSetings.Phone       = objModel.Phone;
                objGenralSetings.Website     = objModel.Website;
                objGenralSetings.Currency    = objModel.Currency;
                objGenralSetings.Customer_ID = Convert.ToInt64(session.UserSession.PIN);

                Response = objSetingManager.AddCompanyProfile(objGenralSetings, session.UserSession.UserId);

                if (Response.ErrorCode == 0)
                {
                    Response = objSetingManager.getGenralSeting(Convert.ToInt64(session.UserSession.PIN));
                    if (Response.ErrorCode == 0)
                    {
                        objSetings.GenralSeting_ID_Auto_PK = Convert.ToInt64(Response.ResponseData.Tables[0].Rows[0]["Genral_Seting_ID_Auto_PK"]);
                        objSetings.Company  = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["ComapanyName"]);
                        objSetings.Address  = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["Address"]);
                        objSetings.City     = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["City"]);
                        objSetings.Stete    = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["State"]);
                        objSetings.Country  = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["Country"]);
                        objSetings.Zipcode  = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["Zipcode"]);
                        objSetings.Phone    = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["Phone"]);
                        objSetings.Website  = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["Website"]);
                        objSetings.Currency = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["Currency"]);
                    }
                    return(View(objSetings));
                }
                else
                {
                    return(View(objSetings));
                }
            }
            catch (Exception ex)
            {
                BAL.Common.LogManager.LogError("AjaxGenralSetings Conto", 1, Convert.ToString(ex.Source), Convert.ToString(ex.Message), Convert.ToString(ex.StackTrace));
                return(View(objSetings));
            }
        }
Esempio n. 2
0
        public ActionResult SetingsHome()
        {
            objResponse       Response   = new objResponse();
            GenralSetingModel objSetings = new GenralSetingModel();

            session = new SessionHelper();
            try
            {
                Response = objSetingManager.getGenralSeting(Convert.ToInt64(session.UserSession.PIN));
                if (Response.ErrorCode == 0)
                {
                    objSetings.GenralSeting_ID_Auto_PK = Convert.ToInt64(Response.ResponseData.Tables[0].Rows[0]["Genral_Seting_ID_Auto_PK"]);
                    objSetings.Company  = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["ComapanyName"]);
                    objSetings.Address  = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["Address"]);
                    objSetings.City     = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["City"]);
                    objSetings.Stete    = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["State"]);
                    objSetings.Country  = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["Country"]);
                    objSetings.Zipcode  = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["Zipcode"]);
                    objSetings.Phone    = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["Phone"]);
                    objSetings.Website  = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["Website"]);
                    objSetings.Currency = Convert.ToString(Response.ResponseData.Tables[0].Rows[0]["Currency"]);

                    //  objSetings.roles = objRoleManager.GetAllRoles();


                    return(View(objSetings));
                }
                else
                {
                    objSetings.roles = objRoleManager.GetAllRoles();
                    return(View(objSetings));
                }
            }
            catch (Exception ex)
            {
                BAL.Common.LogManager.LogError("SetingsHome conto", 1, Convert.ToString(ex.Source), Convert.ToString(ex.Message), Convert.ToString(ex.StackTrace));
                return(View(objSetings));
            }
        }