public HttpResponseMessage AddAccountManagemetData(AccountManagemet objSt, string Token)
        {
            string strJson  = string.Empty;
            var    response = this.Request.CreateResponse(HttpStatusCode.OK);

            try
            {
                using (TTPAPIDataContext DB = new TTPAPIDataContext())
                {
                    AccountManagemet objAccountManagemet = new AccountManagemet();
                    objAccountManagemet.AccountID       = objSt.AccountID;
                    objAccountManagemet.AccountName     = objSt.AccountName;
                    objAccountManagemet.UpdatedBy       = String.Format("{0}{1}", Token.Substring(0, 15), DateTime.Now.ToString());
                    objAccountManagemet.UpdatedDateTime = DateTime.Now;
                    objAccountManagemet.AccountDesc     = objSt.AccountDesc;
                    DB.AccountManagemets.InsertOnSubmit(objAccountManagemet);
                    DB.SubmitChanges();

                    strJson          = "{\"Result\":\"204\"}";
                    response.Content = new StringContent(strJson, Encoding.UTF8, "application/json");
                    return(response);
                }
            }
            catch (Exception ex)
            {
                strJson          = "{\"Result\":\"" + ex.Message + "\"}";
                response.Content = new StringContent(strJson, Encoding.UTF8, "application/json");
                return(response);
            }
        }
        public HttpResponseMessage UpdateAccountManagement(AccountManagemet objaccount, string Token, string AppKey, string AccountId)
        {
            string strJson  = string.Empty;
            var    response = this.Request.CreateResponse(HttpStatusCode.OK);

            try
            {
                Accountmeg objaccountmegment = new Accountmeg();
                string     result            = objaccountmegment.Getresult(AppKey, Token);
                if (result == "true")
                {
                    using (TTPAPIDataContext DB = new TTPAPIDataContext())
                    {
                        var AccountInformation = DB.AccountManagemets.FirstOrDefault(x => x.AccountID == AccountId);
                        if (AccountInformation != null)
                        {
                            AccountInformation.AccountName     = objaccount.AccountName;
                            AccountInformation.UpdatedBy       = String.Format("{0}{1}", Token.Substring(0, 36), DateTime.Now.ToShortDateString());
                            AccountInformation.UpdatedDateTime = DateTime.Now;
                            AccountInformation.AccountDesc     = objaccount.AccountDesc;
                            DB.SubmitChanges();

                            strJson          = "{\"Result\":\"204\"}";
                            response.Content = new StringContent(strJson, Encoding.UTF8, "application/json");
                            return(response);
                        }
                        else
                        {
                            strJson          = "{\"Result\":\"100\"}";
                            response.Content = new StringContent(strJson, Encoding.UTF8, "application/json");
                            return(response);
                        }
                    }
                }

                else
                {
                    strJson          = "{\"Result\":\"Invalide Key\"}";
                    response.Content = new StringContent(strJson, Encoding.UTF8, "application/json");
                    return(response);
                }
            }

            catch (Exception ex)
            {
                strJson          = "{\"Result\":\"" + ex.Message + "\"}";
                response.Content = new StringContent(strJson, Encoding.UTF8, "application/json");
                return(response);
            }
        }
        public HttpResponseMessage AddAccountManagemetData(AccountManagemet objSt, string Token)
        {
            string strJson  = string.Empty;
            var    response = this.Request.CreateResponse(HttpStatusCode.OK);

            try
            {
                using (TTPAPIDataContext DB = new TTPAPIDataContext())
                {
                    if (objSt != null)
                    {
                        var checkAccountmanagment = DB.AccountManagemets.Where(x => x.AccountID == objSt.AccountID).FirstOrDefault();
                        if (checkAccountmanagment == null)
                        {
                            AccountManagemet objAccountManagemet = new AccountManagemet();
                            objAccountManagemet.AccountID       = objSt.AccountID;
                            objAccountManagemet.AccountName     = objSt.AccountName;
                            objAccountManagemet.UpdatedBy       = String.Format("{0}{1}", Token.Substring(0, 36), DateTime.Now.ToShortDateString());
                            objAccountManagemet.UpdatedDateTime = DateTime.Now;
                            objAccountManagemet.AccountDesc     = objSt.AccountDesc;
                            objAccountManagemet.AppKey          = Guid.NewGuid();
                            DB.AccountManagemets.InsertOnSubmit(objAccountManagemet);
                            DB.SubmitChanges();

                            strJson          = "{\"Result\":\"204\"}";
                            response.Content = new StringContent(strJson, Encoding.UTF8, "application/json");
                            return(response);
                        }
                        else
                        {
                            strJson          = "{\"Result\":\"AccountID is Already Use\"}";
                            response.Content = new StringContent(strJson, Encoding.UTF8, "application/json");
                            return(response);
                        }
                    }
                    else
                    {
                        strJson          = "{\"Result\":\"No Input request was passed in the body\"}";
                        response.Content = new StringContent(strJson, Encoding.UTF8, "application/json");
                        return(response);
                    }
                }
            }
            catch (Exception ex)
            {
                strJson          = "{\"Result\":\"" + ex.Message + "\"}";
                response.Content = new StringContent(strJson, Encoding.UTF8, "application/json");
                return(response);
            }
        }