Пример #1
0
 // Use this for initialization
 void Start()
 {
     custom = FindObjectOfType<CustomManager>();
     tpsContent = FindObjectOfType<TPSContent>();
     altered = true;
     buttons = new List<GameObject>();
 }
 // Use this for initialization
 void Start()
 {
     custom = FindObjectOfType<CustomManager>();
     text = GetComponent<Text>();
     button = GetComponent<Button>();
     button.interactable = true;
 }
 // Use this for initialization
 void Start()
 {
     custom = FindObjectOfType<CustomManager>();
     toggle = this.gameObject.GetComponent<Toggle>();
     toggle.onValueChanged.AddListener((on) => custom.nodeIsAccept(toggle.isOn));
     toggle.onValueChanged.AddListener((off) => custom.nodeIsAccept (toggle.isOn));
 }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     custom = FindObjectOfType<CustomManager>();
     sprite = GetComponent<Image>();
     hitSprite = AssetDatabase.LoadAssetAtPath("Assets/Resources/Sprites/Hit graph node old.png", typeof(Sprite)) as Sprite;
     rollSprite = AssetDatabase.LoadAssetAtPath("Assets/Resources/Sprites/Roll graph node.png", typeof(Sprite)) as Sprite;
     snareSprite = AssetDatabase.LoadAssetAtPath("Assets/Resources/Sprites/Snare graph node old.png", typeof(Sprite)) as Sprite;
 }
Пример #5
0
    protected void ddlRegion_SelectedIndexChanged(object sender, EventArgs e)
    {
        ICustomList CustomManager;

        CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration");
        DataTable   DTFindRecord = new DataTable();
        ICustomList PriorManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");

        DTFindRecord = CustomManager.GetCustomMasterLinkRecord(ViewState["TableName"].ToString(), Convert.ToInt32(ddlRegion.SelectedItem.Value));
        DataColumn[] thePKey = new DataColumn[2];
        thePKey[0] = DTFindRecord.Columns[0];
        thePKey[1] = DTFindRecord.Columns[2];
        DTFindRecord.PrimaryKey = thePKey;
        ViewState["GrdData"]    = DTFindRecord;
        Bind_Grid(DTFindRecord);

        //if (DTFindRecord.Rows.Count > 0)
        //{
        //    //FillSelected();
        //    for (int j = 0; j < ddDistrict.Items.Count; j++)
        //    {

        //        ddDistrict.Items[j].Selected = false;


        //    }
        //    for (int i = 0; i < DTFindRecord.Rows.Count; i++)
        //    {
        //        for (int j = 0; j < ddDistrict.Items.Count; j++)
        //        {
        //            if (ddDistrict.Items[j].Value == DTFindRecord.Rows[i][1].ToString())
        //            {
        //                btnSave.Text = "Update";
        //                ddDistrict.Items[j].Selected = true;

        //            }
        //        }
        //    }
        //}
        //else
        //{
        //    for (int j = 0; j < ddDistrict.Items.Count; j++)
        //    {
        //      btnSave.Text = "Save";
        //      ddDistrict.Items[j].Selected = false;


        //    }
        //    //FillNonSelectd();
        //}
    }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            ICustomList CustomManager;

            try
            {
                if (Convert.ToInt32(ddlRegion.SelectedValue) <= 0)
                {
                    MsgBuilder theBuilder = new MsgBuilder();
                    theBuilder.DataElements["Control"] = lblfrom.Text;
                    IQCareMsgBox.Show("BlankDropDown", theBuilder, this);
                    ddlRegion.Focus();
                    return;
                }

                if (Convert.ToInt32(ddDistrict.SelectedValue) <= 0)
                {
                    MsgBuilder theBuilder = new MsgBuilder();
                    theBuilder.DataElements["Control"] = lblto.Text;
                    IQCareMsgBox.Show("BlankDropDown", theBuilder, this);
                    ddDistrict.Focus();
                    return;
                }
                CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration");
                DataTable   DTupdateprior = new DataTable();
                ICustomList PriorManager  = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");

                int       DeleteCount = CustomManager.DeleteCustomMasterLinkRecord(ViewState["TableName"].ToString(), Convert.ToInt32(ddlRegion.SelectedItem.Value));
                DataTable theDT       = (DataTable)ViewState["GrdData"];
                for (int i = 0; i < theDT.Rows.Count; i++)
                {
                    int RowsAffected = CustomManager.SaveUpdateCustomMasterLinkRecord(ViewState["TableName"].ToString(), Convert.ToInt32(theDT.Rows[i][0]), Convert.ToInt32(theDT.Rows[i][2]), Convert.ToInt32(Session["AppUserId"]));
                }

                string theUrl = "frmAdmin_PMTCT_CustomItems.aspx";
                Response.Redirect(theUrl);
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
                return;
            }
            finally
            {
                CustomManager = null;
            }
        }
Пример #7
0
        public ActionResult SaveCustom(Custom custom, string customType)
        {
            #region 保存申请
            if (custom.ID == new Guid())
            {
                custom.ID = Guid.NewGuid();
            }
            custom.CustomType = CustomTypeManager.Get(new Guid(customType));
            custom.CreateUser = UserInfoManager.GetUserSession();
            custom.CreateTime = DateTime.Now;
            CustomManager.SaveOrUpdate(custom);
            #endregion

            return(Content("1"));
        }
        protected void ddlRegion_SelectedIndexChanged(object sender, EventArgs e)
        {
            ICustomList CustomManager;

            CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration");
            DataTable   DTFindRecord = new DataTable();
            ICustomList PriorManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");

            DTFindRecord = CustomManager.GetCustomMasterLinkRecord(ViewState["TableName"].ToString(), Convert.ToInt32(ddlRegion.SelectedItem.Value));
            DataColumn[] thePKey = new DataColumn[2];
            thePKey[0] = DTFindRecord.Columns[0];
            thePKey[1] = DTFindRecord.Columns[2];
            DTFindRecord.PrimaryKey = thePKey;
            ViewState["GrdData"]    = DTFindRecord;
            Bind_Grid(DTFindRecord);
        }
        public void FillNonSelectd()
        {
            ICustomList   CustomManager;
            BindFunctions BindManager = new BindFunctions();

            CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration");
            DataTable   DTFindRecord = new DataTable();
            ICustomList PriorManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");

            DTFindRecord = CustomManager.GetCustomMasterNonSelectedRecord(ViewState["TableName"].ToString());
            if (DTFindRecord != null)
            {
                //BindManager.BindCheckedList(chkDestict, DTFindRecord, "Name", "ID");
                DTFindRecord.Dispose();
                DTFindRecord.Clear();
            }
        }
Пример #10
0
        public ActionResult SaveMaintain(CustomMaintain customMaintain,
                                         String maintainMethod,
                                         String maintainType,
                                         String custom)
        {
            #region 保存申请
            if (customMaintain.ID == new Guid())
            {
                customMaintain.ID = Guid.NewGuid();
            }
            customMaintain.MaintainMethod = MaintainMethodManager.Get(new Guid(maintainMethod));
            customMaintain.MaintainType   = MaintainTypeManager.Get(new Guid(maintainType));
            customMaintain.Custom         = CustomManager.Get(new Guid(custom));
            customMaintain.MaintainUser   = UserInfoManager.GetUserSession();
            customMaintain.CreateUser     = UserInfoManager.GetUserSession();
            customMaintain.CreateTime     = DateTime.Now;
            CustomMaintainManager.SaveOrUpdate(customMaintain);
            #endregion

            return(Content("1"));
        }
Пример #11
0
 public ActionResult GetUserTypes()
 {
     try
     {
         var add   = new KeyContent(0, "Select a User Type");
         var items = CustomManager.GetUserTypes();
         if (items == null || !items.Any())
         {
             return(Json(new List <KeyContent> {
                 add
             }, JsonRequestBehavior.AllowGet));
         }
         var jsonitem = items.Select(o => new KeyContent(o.UserTypeId, o.Name)).ToList();
         jsonitem.Insert(0, add);
         return(Json(jsonitem, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         BugManager.LogApplicationBug(ex.StackTrace, ex.Source, ex.Message);
         return(Json(new List <KeyContent>(), JsonRequestBehavior.AllowGet));
     }
 }
Пример #12
0
        public ActionResult GetStationByOrganizationId(int orgId)
        {
            try
            {
                var add   = new KeyContent(0, "Select a Station");
                var items = CustomManager.GetStationByOrganizationId(orgId);

                if (!items.Any())
                {
                    return(Json(new List <KeyContent> {
                        add
                    }, JsonRequestBehavior.AllowGet));
                }
                var jsonitem = items.Select(o => new KeyContent(o.ClientStationId, o.StationName)).ToList();
                jsonitem.Insert(0, add);
                return(Json(jsonitem, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                BugManager.LogApplicationBug(ex.StackTrace, ex.Source, ex.Message);
                return(Json(new List <KeyContent>(), JsonRequestBehavior.AllowGet));
            }
        }
Пример #13
0
    protected void ddlVillage_SelectedIndexChanged1(object sender, EventArgs e)
    {
        ICustomList CustomManager;

        CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration");
        DataTable   DTFindRecord = new DataTable();
        ICustomList PriorManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");

        if (ddlRegion.SelectedItem.Value != "0" && ddDistric.SelectedItem.Value != "0" && ddWard.SelectedItem.Value != "0" && ddlVillage.SelectedItem.Value != "0")
        {
            DTFindRecord = CustomManager.GetVillageChairperson(Convert.ToInt32(ddlRegion.SelectedItem.Value), Convert.ToInt32(ddDistric.SelectedItem.Value), Convert.ToInt32(ddWard.SelectedItem.Value), Convert.ToInt32(ddlVillage.SelectedItem.Value));
            if (DTFindRecord.Rows.Count > 0)
            {
                txtChairPerson.Text = DTFindRecord.Rows[0][0].ToString();
                btnSave.Text        = "Update";
            }
            else
            {
                txtChairPerson.Text = "";
                btnSave.Text        = "Save";
            }
        }
    }
Пример #14
0
        public ActionResult GetLocalAreaByStateId(int stateId)
        {
            try
            {
                var add   = new KeyContent(0, "Select a Local Government");
                var items = CustomManager.GetLocalAreaByStateId(stateId);

                //var items = new List<LocalArea>
                //{
                //    new LocalArea
                //    {
                //        LocalAreaId = 1,
                //        Name = "Ogba/Egbema/Ndoni"
                //    },
                //    new LocalArea
                //    {
                //        LocalAreaId = 2,
                //        Name = "Omumma"
                //    },
                //};

                if (!items.Any())
                {
                    return(Json(new List <KeyContent> {
                        add
                    }, JsonRequestBehavior.AllowGet));
                }
                var jsonitem = items.Select(o => new KeyContent(o.LocalAreaId, o.Name)).ToList();
                jsonitem.Insert(0, add);
                return(Json(jsonitem, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                BugManager.LogApplicationBug(ex.StackTrace, ex.Source, ex.Message);
                return(Json(new List <KeyContent>(), JsonRequestBehavior.AllowGet));
            }
        }
Пример #15
0
        /// <summary>
        /// Creates an application using the Default skin file.
        /// </summary>
        public TheGameOfLife()
            : base(true)
        {
            _screenManager = new ScreenManager(this);
            Manager        = new CustomManager(this, _screenManager);

            Content.RootDirectory   = "Content";
            Manager.SkinDirectory   = "Content/Skins";
            Manager.LayoutDirectory = "Content/Layouts";


            ClearBackground = true;
            BackgroundColor = Color.White;

            TargetElapsedTime = TimeSpan.FromMilliseconds(1000 / 60f);

            IsFixedTimeStep  = true;
            SystemBorder     = true;
            ExitConfirmation = false;


            Manager.Visible = false;
            _screenManager  = new ScreenManager(this);
        }
Пример #16
0
 /// <summary>
 /// Constructor. Awkward method of setting references needed. However, Harmony patches
 /// are required to be static. Thus we must break good Object Orientated practices.
 /// </summary>
 /// <param name="customManager">The class controlling information pertaining to the customs (and the loaded customs).</param>
 public UpdateWhenCurrentLocationPatch(CustomManager customManager)
 {
     UpdateWhenCurrentLocationPatch.customManager = customManager;
 }
Пример #17
0
 /// <summary>
 /// Constructor. Awkward method of setting references needed. However, Harmony patches
 /// are required to be static. Thus we must break good Object Orientated practices.
 /// </summary>
 /// <param name="CustomManager">The class controlling information pertaining to the customs (and the loaded customs).</param>
 public loadObjectsPatch(CustomManager customManager)
 {
     loadObjectsPatch.customManager = customManager;
 }
Пример #18
0
 /// <summary>
 /// Constructor. Awkward method of setting references needed. However, Harmony patches
 /// are required to be static. Thus we must break good Object Orientated practices.
 /// </summary>
 /// <param name="CustomManager">The class controlling information pertaining to the customs (and the loaded customs).</param>
 public dayUpdatePatch(CustomManager customManager)
 {
     dayUpdatePatch.customManager = customManager;
 }
Пример #19
0
 /// <summary>
 /// Constructor. Awkward method of setting references needed. However, Harmony patches
 /// are required to be static. Thus we must break good Object Orientated practices.
 /// </summary>
 /// <param name="farmManager">The class controlling information pertaining to the custom farms (and the loaded farm).</param>
 public leftClickPatch(CustomManager customManager)
 {
     leftClickPatch.customManager = customManager;
 }
 public setAtFarmPositionPatch(CustomManager customManager)
 {
     setAtFarmPositionPatch.customManager = customManager;
 }
Пример #21
0
    static void Main(string[] args)
    {
        string custom = string.Empty;

        var customManager = new CustomManager <string>();

        while ((custom = Console.ReadLine()) != "END")
        {
            string[] data = custom.Split(" ");

            string write = data[0];

            string value;
            switch (write)
            {
            case "Add":
                value = data[1];
                customManager.Add(value);
                break;

            case "Max":
                Console.WriteLine(customManager.Max());
                break;

            case "Min":
                Console.WriteLine(customManager.Min());
                break;

            case "Greater":
                value = data[1];
                Console.WriteLine(customManager.CountGreatThan(value));
                break;

            case "Swap":
                int indexOne = int.Parse(data[1]);
                int indexTwo = int.Parse(data[2]);
                customManager.Swap(indexOne, indexTwo);
                break;

            case "Sort":
                customManager.Sort();
                break;

            case "Contains":
                value = data[1];
                Console.WriteLine(customManager.Contains(value));
                break;

            case "Print":
                Console.WriteLine(customManager);
                break;

            case "Remove":
                int index = int.Parse(data[1]);
                customManager.Remove(index);
                break;

            default:
                break;
            }
        }
    }
Пример #22
0
 // Use this for initialization
 void Start()
 {
     custom = FindObjectOfType <CustomManager>();
     canvas = FindObjectOfType <Canvas>();
 }
Пример #23
0
 // Use this for initialization
 void Start()
 {
     parent = FindObjectOfType <TPAContent>();
     custom = FindObjectOfType <CustomManager>();
     text   = this.GetComponentInChildren <Text>();
 }
Пример #24
0
 /// <summary>
 /// Constructor. Awkward method of setting references needed. However, Harmony patches
 /// are required to be static. Thus we must break good Object Orientated practices.
 /// </summary>
 /// <param name="customManager">The class controlling information pertaining to the customs (and the loaded customs).</param>
 public setExitLocationPatch(CustomManager customManager)
 {
     setExitLocationPatch.customManager = customManager;
 }
Пример #25
0
 /// <summary>
 /// Constructor. Awkward method of setting references needed. However, Harmony patches
 /// are required to be static. Thus we must break good Object Orientated practices.
 /// </summary>
 /// <param name="CustomManager">The class controlling information pertaining to the customs (and the loaded customs).</param>
 public startEventPatch(CustomManager customManager)
 {
     startEventPatch.customManager = customManager;
 }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (FieldValidation() == false)
            {
                return;
            }

            ICustomList CustomManager;

            try
            {
                CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration");
                DataTable   DTupdateprior = new DataTable();
                ICustomList PriorManager  = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
                if (btnSave.Text == "Save")
                {
                    DTupdateprior = PriorManager.GetCustomListUpdatePriortorize(Convert.ToString(ViewState["TableName"]), Convert.ToInt32(ViewState["CategoryId"]), txtSeqNo.Text, Convert.ToInt32(Session["SystemId"]));
                    if (DTupdateprior.Rows[0]["UpdateFlag"] != System.DBNull.Value)
                    {
                        if (DTupdateprior.Rows[0].IsNull("UpdateFlag") == true)
                        {
                            ViewState["UpdateFlag"] = 1;
                        }
                        else
                        {
                            ViewState["UpdateFlag"] = DTupdateprior.Rows[0]["UpdateFlag"];
                        }

                        if (Convert.ToInt32(ViewState["Updateprior"]) == 2)
                        {
                            IQCareMsgBox.Show("CustomListPriotorize", this);
                            return;
                        }
                    }


                    string strName;
                    strName      = txtName.Text.Trim();
                    txtName.Text = strName.Replace("'", "''");
                    string strCode;
                    strCode      = txtcode.Text.Trim();
                    txtcode.Text = strCode.Replace("'", "''");

                    CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration");
                    DataTable RowsAffected = CustomManager.SaveCustomMasterRecord(ViewState["TableName"].ToString(), ViewState["ListName"].ToString(), txtName.Text.Trim(), txtcode.Text, "", Convert.ToInt32(txtSeqNo.Text), Convert.ToInt32(ViewState["CategoryId"]), Convert.ToInt32(Session["AppUserId"]), Convert.ToInt32(Session["SystemId"]), Convert.ToInt32(ViewState["CCID"]), Convert.ToInt32(ViewState["ModuleId"]), "");
                    if (RowsAffected.Rows.Count <= 0)
                    {
                        MsgBuilder theBuilder = new MsgBuilder();
                        theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();

                        if (Convert.ToInt32(ViewState["CategoryId"]) > 0)
                        {
                            theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();
                        }
                        IQCareMsgBox.Show("CustomMasterExists", theBuilder, this);
                        return;
                    }
                    else
                    {
                        MsgBuilder theBuilder = new MsgBuilder();
                        theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();
                        if (Convert.ToInt32(ViewState["CategoryId"]) == 0)
                        {
                            ViewState["CategoryId"] = RowsAffected.Rows[0][0].ToString();
                        }
                        if (Convert.ToInt32(ViewState["CategoryId"]) > 0)
                        {
                            theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();
                        }
                        IQCareMsgBox.Show("CustomMasterSave", theBuilder, this);
                        Clear_Fields();
                    }
                    //string Url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}", "frmAdmin_IQCCustomList.aspx", ViewState["TableName"].ToString(), ViewState["CategoryId"].ToString(), ViewState["ListName"].ToString(), ViewState["FID"].ToString(), ViewState["Update"].ToString());
                    string Url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&ModId={6}", "frmAdmin_IQCCustomList.aspx", ViewState["TableName"].ToString(), ViewState["CategoryId"].ToString(), ViewState["ListName"].ToString(), ViewState["FID"].ToString(), ViewState["Update"].ToString(), ViewState["ModuleId"].ToString());
                    Response.Redirect(Url);
                }

                else
                {
                    string strName;
                    strName      = txtName.Text.Trim();
                    txtName.Text = strName.Replace("'", "''");
                    string strCode;
                    strCode       = txtcode.Text.Trim();
                    txtcode.Text  = strCode.Replace("'", "''");
                    DTupdateprior = PriorManager.GetCustomListUpdatePriortorize(Convert.ToString(ViewState["TableName"]), Convert.ToInt32(ViewState["CategoryId"]), txtSeqNo.Text, Convert.ToInt32(Session["SystemId"]));
                    if (DTupdateprior.Rows.Count > 0)
                    {
                        if (DTupdateprior.Rows[0]["UpdateFlag"] != System.DBNull.Value)
                        {
                            if (DTupdateprior.Rows[0].IsNull("UpdateFlag") == true)
                            {
                                ViewState["UpdateFlag"] = 0;
                            }
                            else
                            {
                                ViewState["UpdateFlag"] = DTupdateprior.Rows[0]["UpdateFlag"];
                            }

                            if (Convert.ToInt32(ViewState["Updateprior"]) == 2)
                            {
                                IQCareMsgBox.Show("CustomListPriotorize", this);
                                return;
                            }
                        }
                    }
                    if (txtSeqNo.Text != "")
                    {
                        CustomManager.UpdateCustomMasterRecord(ViewState["TableName"].ToString(), Convert.ToInt32(ViewState["Id"]), txtName.Text.Trim(), txtcode.Text.Trim(), "", Convert.ToInt32(txtSeqNo.Text), Convert.ToInt32(ViewState["CategoryId"]), Convert.ToInt32(ddStatus.SelectedValue), Convert.ToInt32(Session["AppUserId"]), Convert.ToInt32(Session["SystemId"]), Convert.ToInt32(ViewState["CCID"]), Convert.ToInt32(ViewState["ModuleId"]), "");
                    }
                    else
                    {
                        CustomManager.UpdateCustomMasterRecord(ViewState["TableName"].ToString(), Convert.ToInt32(ViewState["Id"]), txtName.Text.Trim(), txtcode.Text.Trim(), "", 0, Convert.ToInt32(ViewState["CategoryId"]), Convert.ToInt32(ddStatus.SelectedValue), Convert.ToInt32(Session["AppUserId"]), Convert.ToInt32(Session["SystemId"]), Convert.ToInt32(ViewState["CCID"]), Convert.ToInt32(ViewState["ModuleId"]), "");
                    }
                    if (ddStatus.SelectedValue == "1" & txtSeqNo.Text == "")
                    {
                        IQCareMsgBox.Show("CustomListInactiveUpdate", this);
                    }
                    else
                    {
                        MsgBuilder theBuilder = new MsgBuilder();
                        theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();
                        if (Convert.ToInt32(ViewState["CategoryId"]) > 0)
                        {
                            theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();
                        }
                        IQCareMsgBox.Show("CustomMasterUpdate", theBuilder, this);

                        ViewState["Id"] = 0;
                        //Clear_Fields();
                        //string Url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}", "frmAdmin_IQCCustomList.aspx", ViewState["TableName"].ToString(), ViewState["CategoryId"].ToString(), ViewState["ListName"].ToString(), ViewState["FID"].ToString(), ViewState["Update"].ToString());
                        string Url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&ModId={6}", "frmAdmin_IQCCustomList.aspx", ViewState["TableName"].ToString(), ViewState["CategoryId"].ToString(), ViewState["ListName"].ToString(), ViewState["FID"].ToString(), ViewState["Update"].ToString(), ViewState["ModuleId"].ToString());
                        Response.Redirect(Url);
                    }
                }
            }

            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
                return;
            }
            finally
            {
                CustomManager = null;
            }
        }
Пример #27
0
 /// <summary>
 /// Constructor. Awkward method of setting references needed. However, Harmony patches
 /// are required to be static. Thus we must break good Object Orientated practices.
 /// </summary>
 /// <param name="customManager">The class controlling information pertaining to the customs (and the loaded customs).</param>
 public ConstructorFarmPatch(CustomManager customManager)
 {
     ConstructorFarmPatch.customManager = customManager;
 }
 public IDictionary <int, string> Get()
 {
     return(CustomManager.AllScreens());
 }
Пример #29
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (FieldValidation() == false)
        {
            return;
        }

        ICustomList CustomManager;

        try
        {
            CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration");
            DataTable DTupdateprior = new DataTable();
            DataSet   DStheXML      = new DataSet();
            DStheXML.ReadXml(MapPath("..\\XMLFiles\\customizelist.xml"));
            DataView theDV = new DataView(DStheXML.Tables["ItemName"]);

            theDV.RowFilter = "TableName='" + ViewState["TableName"] + "' and CategoryId='" + ViewState["CategoryId"] + "' and CountryID='" + ViewState["CCID"] + "' and ModuleId='" + ViewState["ModuleId"] + "'";
            DataTable theDT = theDV.ToTable();
            int       SystemID;
            if (theDT.Rows.Count > 0)
            {
                SystemID = Convert.ToInt32(theDT.Rows[0]["SystemId"]);
            }
            else
            {
                SystemID = Convert.ToInt32(Session["SystemId"]);
            }

            ICustomList PriorManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
            if (btnSave.Text == "Save")
            {
                DTupdateprior = PriorManager.GetCustomListUpdatePriortorize(Convert.ToString(ViewState["TableName"]), Convert.ToInt32(ViewState["CategoryId"]), txtSeqNo.Text, SystemID);
                if (DTupdateprior.Rows[0]["UpdateFlag"] != System.DBNull.Value)
                {
                    if (DTupdateprior.Rows[0].IsNull("UpdateFlag") == true)
                    {
                        ViewState["UpdateFlag"] = 0;
                    }
                    else
                    {
                        ViewState["UpdateFlag"] = DTupdateprior.Rows[0]["UpdateFlag"];
                    }
                    if (Convert.ToInt32(ViewState["Updateprior"]) == 2)
                    {
                        IQCareMsgBox.Show("CustomListPriotorize", this);
                        return;
                    }
                }
                string strName;
                strName      = txtName.Text.Trim();
                txtName.Text = strName.Replace("'", "''");
                if (ViewState["CCID"].ToString() == "")
                {
                    ViewState["CCID"] = 0;
                }
                //Extracting SystemID
                string strMultiplier = "";
                if (rdinteger.Checked)
                {
                    strMultiplier = txtmultiplier.Text;
                }

                DataTable RowsAffected = CustomManager.SaveCustomMasterRecord(ViewState["TableName"].ToString(), ViewState["ListName"].ToString(), txtName.Text.Trim(), "", "", Convert.ToInt32(txtSeqNo.Text),
                                                                              Convert.ToInt32(ViewState["CategoryId"]), Convert.ToInt32(Session["AppUserId"]), SystemID, Convert.ToInt32(ViewState["CCID"]), Convert.ToInt32(ViewState["ModuleId"]), strMultiplier);
                if (RowsAffected.Rows.Count <= 0)
                {
                    MsgBuilder theBuilder = new MsgBuilder();
                    theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();

                    if (Convert.ToInt32(ViewState["CategoryId"]) > 0)
                    {
                        theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();
                    }
                    IQCareMsgBox.Show("CustomMasterExists", theBuilder, this);
                    return;
                }
                else
                {
                    MsgBuilder theBuilder = new MsgBuilder();
                    theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();
                    //if (Convert.ToInt32(ViewState["CategoryId"]) == 0)
                    //{
                    //    ViewState["CategoryId"] = RowsAffected.Rows[0][0].ToString();
                    //}
                    if (Convert.ToInt32(RowsAffected.Rows[0][0].ToString()) > 0)
                    {
                        theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();
                    }
                    IQCareMsgBox.Show("CustomMasterSave", theBuilder, this);
                    Clear_Fields();
                }
                //string Url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&CCID={6}", "frmAdmin_CustomList.aspx", ViewState["TableName"].ToString(), ViewState["CategoryId"], ViewState["ListName"].ToString(), ViewState["FID"].ToString(), ViewState["Update"].ToString(), ViewState["CCID"].ToString());
                string Url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&CCID={6}&ModId={7}", "frmAdmin_CustomList.aspx", ViewState["TableName"].ToString(), ViewState["CategoryId"], ViewState["ListName"].ToString(), ViewState["FID"].ToString(), ViewState["Update"].ToString(), ViewState["CCID"].ToString(), ViewState["ModuleId"].ToString());
                Response.Redirect(Url);
            }
            else
            {
                string strName;
                strName      = txtName.Text.Trim();
                txtName.Text = strName.Replace("'", "''");
                string strMultiplier = "";
                if (rdinteger.Checked)
                {
                    strMultiplier = txtmultiplier.Text;
                }
                DTupdateprior = PriorManager.GetCustomListUpdatePriortorize(Convert.ToString(ViewState["TableName"]), Convert.ToInt32(ViewState["CategoryId"]), txtSeqNo.Text, Convert.ToInt32(Session["SystemId"].ToString()));
                if (DTupdateprior.Rows.Count > 0)
                {
                    if (DTupdateprior.Rows[0]["UpdateFlag"] != System.DBNull.Value)
                    {
                        if (DTupdateprior.Rows[0].IsNull("UpdateFlag") == true)
                        {
                            ViewState["UpdateFlag"] = 0;
                        }
                        else
                        {
                            ViewState["UpdateFlag"] = DTupdateprior.Rows[0]["UpdateFlag"];
                        }
                        if (Convert.ToInt32(ViewState["Updateprior"]) == 2)
                        {
                            IQCareMsgBox.Show("CustomListPriotorize", this);
                            return;
                        }
                    }
                }
                if (ViewState["CCID"].ToString() == "")
                {
                    ViewState["CCID"] = 0;
                }

                if (txtSeqNo.Text != "")
                {
                    CustomManager.UpdateCustomMasterRecord(Convert.ToString(ViewState["TableName"]), Convert.ToInt32(ViewState["Id"]), txtName.Text.Trim(), "", "", Convert.ToInt32(txtSeqNo.Text), Convert.ToInt32(ViewState["CategoryId"]), Convert.ToInt32(ddStatus.SelectedValue), Convert.ToInt32(Session["AppUserId"]), SystemID, Convert.ToInt32(ViewState["CCID"]), Convert.ToInt32(ViewState["ModuleId"]), strMultiplier);
                }
                else
                {
                    CustomManager.UpdateCustomMasterRecord(Convert.ToString(ViewState["TableName"]), Convert.ToInt32(ViewState["Id"]), txtName.Text.Trim(), "", "", 0, Convert.ToInt32(ViewState["CategoryId"]), Convert.ToInt32(ddStatus.SelectedValue), Convert.ToInt32(Session["AppUserId"]), SystemID, Convert.ToInt32(ViewState["CCID"]), Convert.ToInt32(ViewState["ModuleId"]), strMultiplier);
                }


                if (ddStatus.SelectedValue == "1" & txtSeqNo.Text == "")
                {
                    IQCareMsgBox.Show("CustomListInactiveUpdate", this);
                }
                else
                {
                    MsgBuilder theBuilder = new MsgBuilder();
                    theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();
                    if (Convert.ToInt32(ViewState["CategoryId"]) > 0)
                    {
                        theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();
                    }
                    IQCareMsgBox.Show("CustomMasterUpdate", theBuilder, this);
                    ViewState["Id"] = 0;
                    Clear_Fields();

                    string Url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&CCID={6}&ModId={7}", "frmAdmin_CustomList.aspx", ViewState["TableName"].ToString(), ViewState["CategoryId"].ToString(), ViewState["ListName"].ToString(), ViewState["FID"].ToString(), ViewState["Update"].ToString(), ViewState["CCID"].ToString(), ViewState["ModuleId"].ToString());
                    //string Url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&CCID={6}", "frmAdmin_CustomList.aspx", ViewState["TableName"].ToString(), ViewState["CategoryId"].ToString(), ViewState["ListName"].ToString(), ViewState["FID"].ToString(), ViewState["Update"].ToString(), ViewState["CCID"].ToString());
                    //string Url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}", "frmAdmin_CustomList.aspx", ViewState["TableName"].ToString(), ViewState["CategoryId"].ToString(), ViewState["ListName"].ToString(), ViewState["FID"].ToString(), ViewState["Update"].ToString());
                    Response.Redirect(Url);
                }
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
            return;
        }
        finally
        {
            CustomManager = null;
        }
    }
 // Use this for initialization
 void Start()
 {
     button  = GetComponent<Button>();
     custom = FindObjectOfType<CustomManager>();
 }
Пример #31
0
 // Use this for initialization
 void Start()
 {
     customManager = FindObjectOfType<CustomManager>();
 }
Пример #32
0
 /// <summary>
 /// Constructor. Awkward method of setting references needed. However, Harmony patches
 /// are required to be static. Thus we must break good Object Orientated practices.
 /// </summary>
 /// <param name="farmManager">The class controlling information pertaining to the customs (and the loaded customs).</param>
 /// <param name="Monitor">SMAPI's IMonitor, to print out useful information to user.</param>
 public loadForNewGamePatch(CustomManager customManager, IMonitor Monitor)
 {
     loadForNewGamePatch.customManager = customManager;
     loadForNewGamePatch.Monitor       = Monitor;
 }
 // Use this for initialization
 void Start()
 {
     custom = FindObjectOfType<CustomManager>();
     canvas = FindObjectOfType<Canvas>();
 }
Пример #34
0
 // Use this for initialization
 void Start()
 {
     custom = FindObjectOfType<CustomManager>();
     button = this.gameObject.GetComponentInChildren<Button>();
     button.onClick.AddListener(() => custom.deleteLoop());
 }
 // Use this for initialization
 void Start()
 {
     custom = FindObjectOfType<CustomManager>();
     parent = FindObjectOfType<TPSContent>();
     text = this.GetComponentInChildren<Text>();
 }
Пример #36
0
 // Use this for initialization
 void Start()
 {
     input = "";
     custom = FindObjectOfType<CustomManager>();
 }
Пример #37
0
 /// <summary>
 /// Constructor. Awkward method of setting references needed. However, Harmony patches
 /// are required to be static. Thus we must break good Object Orientated practices.
 /// </summary>
 /// <param name="customManager">The class controlling information pertaining to the customs (and the loaded customs).</param>
 public ConstructorFarmHousePatch(CustomManager customManager)
 {
     ConstructorFarmHousePatch.customManager = customManager;
     SwappedID = -1;
 }
Пример #38
0
 // Use this for initialization
 void Start()
 {
     customManager = GameObject.FindObjectOfType <CustomManager>();
 }
 // Use this for initialization
 void Start()
 {
     button = GetComponent <Button>();
     custom = FindObjectOfType <CustomManager>();
 }
Пример #40
0
 /// <summary>
 /// Constructor. Awkward method of setting references needed. However, Harmony patches
 /// are required to be static. Thus we must break good Object Orientated practices.
 /// </summary>
 /// <param name="CustomManager">The class controlling information pertaining to the customs (and the loaded customs).</param>
 public setUpPatch(CustomManager customManager)
 {
     setUpPatch.customManager = customManager;
 }