Beispiel #1
0
        public static bool Save_OrganizationAccountant(bool isOnlyDelete, OrganizationAccountantInfo obj, UserInfo objUserInfo, out string errormsg)
        {
            errormsg = "";
            flag     = false;
            if (!Validations.ValidateDataType(obj.OrganizationCode, Validations.ValueType.AlphaNumericSpecialChar, false, "Organization", out errormsg))
            {
                return(false);
            }
            if (!Validations.ValidateDataType(obj.AccountantCode, Validations.ValueType.AlphaNumericSpecialChar, false, "Accountant", out errormsg))
            {
                return(false);
            }

            using (DBHelper dbhlper = new DBHelper("spMapOrganizationAccountantSave", true))
            {
                DBHelper.AddPparameter("@ID", obj.ID.Trim().Length > 0 ? obj.ID : "0", DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@AccountantCode", obj.AccountantCode, DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@OrganizationCode", obj.OrganizationCode, DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@isOnlyDelete", (isOnlyDelete ? "Y" : "N"), DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@UserCode", objUserInfo.UserCode.ToString().Trim(), DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@ErrorMessage", errormsg, DBHelper.param_types.Varchar, 500, DBHelper.param_direction.Output);

                return(DBHelper.Execute_NonQuery(out errormsg));
            }
        }
Beispiel #2
0
        public ActionResult Save_OrganizationAccountant(string isOnlyDelete, string ID, string AccountantCode, string OrganizationCode)
        {
            using (Auth_Svc.UserAuthenticationServiceClient iGstSvc = new Auth_Svc.UserAuthenticationServiceClient())
            {
                if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
                {
                    OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
                }

                OrganizationAccountantInfo obj = new OrganizationAccountantInfo();
                obj.OrganizationCode = OrganizationCode;
                obj.AccountantCode   = AccountantCode;
                obj.ID = ID;

                if (iGstSvc.Save_OrganizationAccountant(isOnlyDelete.Trim().ToUpper() == "Y", obj, ((UserInfo)Session["UserDetails"]), out ErrorMessage))
                {
                    return(Json("Ok", JsonRequestBehavior.AllowGet));
                }
            }

            return(Json(ErrorMessage, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
        public static List <OrganizationAccountantInfo> GetList_OrganizationAccountant(string ID, string OrganizationCode, string AccountantCode, bool IsAudit)
        {
            using (DBHelper dbhlper = new DBHelper("[spMapOrganizationAccountantGet]"))
            {
                DBHelper.AddPparameter("@Mode", 0);
                DBHelper.AddPparameter("@ID", ID.Trim().Length > 0 ? ID.Trim() : "0");
                DBHelper.AddPparameter("@AccountantCode", AccountantCode);
                DBHelper.AddPparameter("@OrganizationCode", OrganizationCode);

                using (DataSet ds = DBHelper.Execute_Query())
                {
                    if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    {
                        List <OrganizationAccountantInfo> list = new List <OrganizationAccountantInfo>();
                        OrganizationAccountantInfo        obj  = null;

                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            obj    = new OrganizationAccountantInfo();
                            obj.ID = dr["ID"].ToString();
                            obj.OrganizationCode = dr["OrganizationCode"].ToString();
                            obj.OrganizationName = dr["OrganizationName"].ToString();
                            obj.AccountantCode   = dr["AccountantCode"].ToString();
                            obj.AccountantName   = dr["AccountantName"].ToString();

                            list.Add(obj);
                        }

                        return(list);
                    }
                }
            }

            var list1 = new List <OrganizationAccountantInfo>();

            list1.Add(new OrganizationAccountantInfo());
            return(list1);
        }
 public bool Save_OrganizationAccountant(bool isOnlyDelete, OrganizationAccountantInfo obj, UserInfo objUserInfo, out string errormsg)
 {
     return(wscalls.Save_OrganizationAccountant(isOnlyDelete, obj, objUserInfo, out errormsg));
 }